aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt/GLJPanel.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index eb8c68263..61e1429b6 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -227,11 +227,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
// The user really should not be invoking remove() from this
// thread -- but since he/she is, we can not go over to the
// EDT at this point. Try to destroy the context from here.
- drawableHelper.invokeGL(disposeDrawable, disposeContext, disposeAction, null);
- } else {
+ if(disposeContext.isCreated()) {
+ drawableHelper.invokeGL(disposeDrawable, disposeContext, disposeAction, null);
+ }
+ } else if(disposeContext.isCreated()) {
Threading.invokeOnOpenGLThread(disposeOnEventDispatchThreadAction);
}
- } else {
+ } else if(disposeContext.isCreated()) {
drawableHelper.invokeGL(disposeDrawable, disposeContext, disposeAction, null);
}