diff options
author | Sven Gothel <[email protected]> | 2013-11-23 13:22:13 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-11-23 13:22:13 +0100 |
commit | 42f56dea3dc31de8049186825e18dc4b4767827e (patch) | |
tree | f89f98dee86fe6376e065a1c5450a811188d7c60 /src/newt | |
parent | 87fa56ba6f88b3f87199c70324b919dc4ae4e6cf (diff) |
JOGLNewtAppletBase's windowDestroyNotify(): Double check 'awtParent' before reparenting 'back to parent'
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java index d17d2e77c..2c4f25804 100644 --- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java +++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java @@ -166,18 +166,19 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { // Closing action: back to parent! @Override public void windowDestroyNotify(WindowEvent e) { - if( isValid() && WindowClosingMode.DO_NOTHING_ON_CLOSE == glWindow.getDefaultCloseOperation() ) { - if(null == glWindow.getParent()) { - // we may be called directly by the native EDT - new Thread(new Runnable() { - @Override - public void run() { - if( glWindow.isNativeValid() ) { - glWindow.reparentWindow(awtParent); - } - } - }).start(); - } + if( isValid() && WindowClosingMode.DO_NOTHING_ON_CLOSE == glWindow.getDefaultCloseOperation() && + null == glWindow.getParent() && null != awtParent && 0 != awtParent.getWindowHandle() ) + { + Thread.dumpStack(); + // we may be called directly by the native EDT + new Thread(new Runnable() { + @Override + public void run() { + if( glWindow.isNativeValid() && null != awtParent && 0 != awtParent.getWindowHandle() ) { + glWindow.reparentWindow(awtParent); + } + } + }).start(); } } } ); |