summaryrefslogtreecommitdiffstats
path: root/src/demos/es2/RedSquare.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/es2/RedSquare.java')
-rwxr-xr-xsrc/demos/es2/RedSquare.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java
index be7e7f5..65f70c2 100755
--- a/src/demos/es2/RedSquare.java
+++ b/src/demos/es2/RedSquare.java
@@ -13,6 +13,7 @@ import com.sun.javafx.newt.opengl.*;
public class RedSquare extends Thread implements WindowListener, KeyListener, MouseListener, GLEventListener {
+ public Window nWindow = null;
public GLWindow window;
private GLProfile glp;
private boolean quit = false;
@@ -98,7 +99,6 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
try {
GLCapabilities caps = new GLCapabilities(glp);
- Window nWindow = null;
if(0!=(type&USE_AWT)) {
Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null); // local display
Screen nScreen = NewtFactory.createScreen(NativeWindowFactory.TYPE_AWT, nDisplay, 0); // screen 0
@@ -147,6 +147,11 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
if(oneThread) {
window.getFactory().shutdown();
}
+ window = null;
+ if(null!=nWindow) {
+ nWindow.destroy();
+ nWindow=null;
+ }
System.out.println("SHUTDOWN "+Thread.currentThread()+" cleanly");
} catch (Throwable t) {
t.printStackTrace();