aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/render
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2006-12-11 16:38:09 +0000
committerCarsten Weisse <[email protected]>2006-12-11 16:38:09 +0000
commitbf19678e01275ff4ab0a85e8f27b3c5ee646d952 (patch)
treecf97bf0bb0ef3e74bfca3dc0888461da5abc42ec /src/jake2/render
parent2e398de9471ae2bef2ad5387a54f4b841168f056 (diff)
destroy gl context in the canvas removeNotify
Diffstat (limited to 'src/jake2/render')
-rw-r--r--src/jake2/render/opengl/Jsr231Driver.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/jake2/render/opengl/Jsr231Driver.java b/src/jake2/render/opengl/Jsr231Driver.java
index 076b6fd..ffb7d29 100644
--- a/src/jake2/render/opengl/Jsr231Driver.java
+++ b/src/jake2/render/opengl/Jsr231Driver.java
@@ -2,7 +2,7 @@
* JoglCommon.java
* Copyright (C) 2004
*
- * $Id: Jsr231Driver.java,v 1.16 2006-12-11 15:54:41 cawe Exp $
+ * $Id: Jsr231Driver.java,v 1.17 2006-12-11 16:38:09 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -53,7 +53,7 @@ public abstract class Jsr231Driver extends Jsr231GL implements GLDriver {
private GraphicsDevice device;
private DisplayMode oldDisplayMode;
private Display display;
- Frame window;
+ private volatile Frame window;
// window position on the screen
int window_xpos, window_ypos;
@@ -247,7 +247,6 @@ public abstract class Jsr231Driver extends Jsr231GL implements GLDriver {
e.printStackTrace();
}
if (window != null) {
- display.destroy();
window.dispose();
}
}
@@ -349,6 +348,8 @@ public abstract class Jsr231Driver extends Jsr231GL implements GLDriver {
}
public void removeNotify() {
+ release();
+ context.destroy();
drawable.setRealized(false);
super.removeNotify();
}
@@ -368,12 +369,6 @@ public abstract class Jsr231Driver extends Jsr231GL implements GLDriver {
drawable.swapBuffers();
}
- void destroy() {
- release();
- context.destroy();
- drawable.setRealized(false);
- }
-
private static GraphicsConfiguration unwrap(AWTGraphicsConfiguration config) {
if (config == null) {
return null;