summaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/GLContextImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun/opengl/impl/GLContextImpl.java')
-rw-r--r--src/classes/com/sun/opengl/impl/GLContextImpl.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java
index d79de9f5a..0910fe250 100644
--- a/src/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -123,15 +123,22 @@ public abstract class GLContextImpl extends GLContext {
// If we are tracking creation and destruction of server-side
// OpenGL objects, we must decrement the reference count of the
// GLObjectTracker upon context destruction.
- int res = makeCurrent();
- if (res != CONTEXT_CURRENT) {
- // FIXME: we really need to behave better than this
- throw new GLException("Unable to make context current to destroy tracked server-side OpenGL objects");
- }
try {
- tracker.unref(getGL());
- } finally {
- release();
+ int res = makeCurrent();
+ if (res != CONTEXT_CURRENT) {
+ // FIXME: we really need to behave better than this
+ throw new GLException("Unable to make context current to destroy tracked server-side OpenGL objects");
+ }
+ try {
+ tracker.unref(getGL());
+ } finally {
+ release();
+ }
+ } catch (GLException e) {
+ // FIXME: should probably do something more intelligent here
+ if (DEBUG) {
+ e.printStackTrace();
+ }
}
}
}