summaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-03-06 02:32:13 +0000
committerKenneth Russel <[email protected]>2006-03-06 02:32:13 +0000
commit105657635735301b729daf613cad3628400a96c6 (patch)
treefc8e2754a7b4d0dc0f55afbd4338801f05b24f92 /src/classes/com/sun/opengl
parent3c922767789d702754cb4831e4bfb1df22d4ca7a (diff)
Use try/finally in X11GLContext.destroyImpl() to avoid any potential
problems in leaving AWT toolkit locked git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@650 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl')
-rw-r--r--src/classes/com/sun/opengl/impl/x11/X11GLContext.java31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLContext.java b/src/classes/com/sun/opengl/impl/x11/X11GLContext.java
index 54d1c62f3..fa0265e7e 100644
--- a/src/classes/com/sun/opengl/impl/x11/X11GLContext.java
+++ b/src/classes/com/sun/opengl/impl/x11/X11GLContext.java
@@ -168,22 +168,25 @@ public abstract class X11GLContext extends GLContextImpl {
protected void destroyImpl() throws GLException {
lockToolkit();
- if (context != 0) {
- if (DEBUG) {
- System.err.println("glXDestroyContext(0x" +
- Long.toHexString(mostRecentDisplay) +
- ", 0x" +
- Long.toHexString(context) + ")");
- }
- GLX.glXDestroyContext(mostRecentDisplay, context);
- if (DEBUG) {
- System.err.println("!!! Destroyed OpenGL context " + context);
+ try {
+ if (context != 0) {
+ if (DEBUG) {
+ System.err.println("glXDestroyContext(0x" +
+ Long.toHexString(mostRecentDisplay) +
+ ", 0x" +
+ Long.toHexString(context) + ")");
+ }
+ GLX.glXDestroyContext(mostRecentDisplay, context);
+ if (DEBUG) {
+ System.err.println("!!! Destroyed OpenGL context " + context);
+ }
+ context = 0;
+ mostRecentDisplay = 0;
+ GLContextShareSet.contextDestroyed(this);
}
- context = 0;
- mostRecentDisplay = 0;
- GLContextShareSet.contextDestroyed(this);
+ } finally {
+ unlockToolkit();
}
- unlockToolkit();
}
public boolean isCreated() {