diff options
author | Carsten Weisse <[email protected]> | 2006-12-11 15:43:44 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2006-12-11 15:43:44 +0000 |
commit | 1e5a1d16fb74a946feadb3390ebf5ef2ccf68078 (patch) | |
tree | 7a0d8afa3c3cffbf5f4e91c97a2fcec1daa42400 /src | |
parent | 6f71cae9e1fc48172eeef46f51336bd98217fb08 (diff) |
destroy window in the awt event dispatcher thread
Diffstat (limited to 'src')
-rw-r--r-- | src/jake2/render/opengl/Jsr231Driver.java | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/jake2/render/opengl/Jsr231Driver.java b/src/jake2/render/opengl/Jsr231Driver.java index 14a8f4f..949faa6 100644 --- a/src/jake2/render/opengl/Jsr231Driver.java +++ b/src/jake2/render/opengl/Jsr231Driver.java @@ -2,7 +2,7 @@ * JoglCommon.java * Copyright (C) 2004 * - * $Id: Jsr231Driver.java,v 1.14 2006-12-07 22:31:10 cawe Exp $ + * $Id: Jsr231Driver.java,v 1.15 2006-12-11 15:43:44 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -228,24 +228,33 @@ public abstract class Jsr231Driver extends Jsr231GL implements GLDriver { } public void shutdown() { - if (oldDisplayMode != null && device.getFullScreenWindow() != null) { - try { + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + if (oldDisplayMode != null + && device.getFullScreenWindow() != null) { + try { if (device.isFullScreenSupported()) - device.setDisplayMode(oldDisplayMode); + device.setDisplayMode(oldDisplayMode); device.setFullScreenWindow(null); - } catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); + } } - } - if (window != null) { - display.destroy(); - window.dispose(); - } + if (window != null) { + display.destroy(); + window.dispose(); + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } } /** - * @return true - */ + * @return true + */ public boolean init(int xpos, int ypos) { // set window position window_xpos = xpos; |