From 42f56dea3dc31de8049186825e18dc4b4767827e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 23 Nov 2013 13:22:13 +0100 Subject: JOGLNewtAppletBase's windowDestroyNotify(): Double check 'awtParent' before reparenting 'back to parent' --- .../jogamp/newt/awt/applet/JOGLNewtAppletBase.java | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/newt') 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(); } } } ); -- cgit v1.2.3