aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt/GLCanvas.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java26
1 files changed, 20 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 0599c1086..ca5cf0e45 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -1232,26 +1232,32 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
animatorPaused = false;
}
+ GLException exceptionOnDisposeGL = null;
+
// OLS will be detached by disposeGL's context destruction below
if( null != context ) {
if( context.isCreated() ) {
- // Catch dispose GLExceptions by GLEventListener, just 'print' them
- // so we can continue with the destruction.
try {
helper.disposeGL(GLCanvas.this, context, true);
if(DEBUG) {
System.err.println(getThreadName()+": destroyOnEDTAction() - post ctx: "+context);
}
} catch (final GLException gle) {
- gle.printStackTrace();
+ exceptionOnDisposeGL = gle;
}
}
context = null;
}
+
+ Throwable exceptionOnUnrealize = null;
if( null != drawable ) {
- drawable.setRealized(false);
- if(DEBUG) {
- System.err.println(getThreadName()+": destroyOnEDTAction() - post drawable: "+drawable);
+ try {
+ drawable.setRealized(false);
+ if(DEBUG) {
+ System.err.println(getThreadName()+": destroyOnEDTAction() - post drawable: "+drawable);
+ }
+ } catch( final Throwable re ) {
+ exceptionOnUnrealize = re;
}
drawable = null;
}
@@ -1260,6 +1266,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
animator.resume();
}
+ // throw exception in order of occurrence ..
+ if( null != exceptionOnDisposeGL ) {
+ throw exceptionOnDisposeGL;
+ }
+ if( null != exceptionOnUnrealize ) {
+ throw GLException.newGLException(exceptionOnUnrealize);
+ }
+
if(DEBUG) {
System.err.println(getThreadName()+": dispose() - END, animator "+animator);
}