From bf19678e01275ff4ab0a85e8f27b3c5ee646d952 Mon Sep 17 00:00:00 2001 From: Carsten Weisse Date: Mon, 11 Dec 2006 16:38:09 +0000 Subject: destroy gl context in the canvas removeNotify --- src/jake2/render/opengl/Jsr231Driver.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src') 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; -- cgit v1.2.3