summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java8
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java8
2 files changed, 10 insertions, 6 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index 9932f0cf9..be42e1da1 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -320,11 +320,13 @@ public class GLCanvas extends Canvas 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(drawable, context, disposeAction, null);
- } else {
+ if(context.isCreated()) {
+ drawableHelper.invokeGL(drawable, context, disposeAction, null);
+ }
+ } else if(context.isCreated()) {
Threading.invokeOnOpenGLThread(disposeOnEventDispatchThreadAction);
}
- } else {
+ } else if(context.isCreated()) {
drawableHelper.invokeGL(drawable, context, disposeAction, null);
}
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);
}