summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-11-23 13:22:13 +0100
committerSven Gothel <[email protected]>2013-11-23 13:22:13 +0100
commit42f56dea3dc31de8049186825e18dc4b4767827e (patch)
treef89f98dee86fe6376e065a1c5450a811188d7c60 /src/newt/classes/com/jogamp
parent87fa56ba6f88b3f87199c70324b919dc4ae4e6cf (diff)
JOGLNewtAppletBase's windowDestroyNotify(): Double check 'awtParent' before reparenting 'back to parent'
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java25
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();
}
} } );