From a968068d835a28610bd63e6eec5043cb4592cf08 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 9 Nov 2011 21:51:54 +0100 Subject: NewtCanvasAWT: Fix NPE (regression from commit 46542168d64b37f544f61802693f15b59b224e4e) --- src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index 4aaffb61f..1bcd8c39e 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -345,8 +345,10 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto System.err.println("NewtCanvasAWT.destroy(): "+newtChild+", from "+cont); } configureNewtChild(false); - nativeWindow.destroy(); - nativeWindow=null; + if(null!=nativeWindow) { + nativeWindow.destroy(); + nativeWindow=null; + } newtChild.setVisible(false); newtChild.reparentWindow(null); newtChild.destroy(); -- cgit v1.2.3