diff options
Diffstat (limited to 'src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java')
-rw-r--r-- | src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java b/src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java index d6b79cb8f..e666fc152 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java +++ b/src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java @@ -54,38 +54,19 @@ public class X11OnscreenGLContext extends X11GLContext { } protected int makeCurrentImpl() throws GLException { + int lockRes = drawable.lockSurface(); try { - int lockRes = drawable.lockSurface(); if (lockRes == X11OnscreenGLDrawable.LOCK_SURFACE_NOT_READY) { return CONTEXT_NOT_CURRENT; } if (lockRes == X11OnscreenGLDrawable.LOCK_SURFACE_CHANGED) { - if (context != 0) { - GLX.glXDestroyContext(mostRecentDisplay, context); - GLContextShareSet.contextDestroyed(this); - if (DEBUG) { - System.err.println(getThreadName() + ": !!! Destroyed OpenGL context " + toHexString(context) + " due to JAWT_LOCK_SURFACE_CHANGED"); - } - context = 0; - } + destroyImpl(); } - int ret = super.makeCurrentImpl(); - return ret; - } catch (RuntimeException e) { - try { + return super.makeCurrentImpl(); + } finally { + if (lockRes != X11OnscreenGLDrawable.LOCK_SURFACE_NOT_READY) { drawable.unlockSurface(); - } catch (Exception e2) { - // do nothing if unlockSurface throws } - throw(e); - } - } - - protected void releaseImpl() throws GLException { - try { - super.releaseImpl(); - } finally { - drawable.unlockSurface(); } } |