diff options
author | Sven Gothel <[email protected]> | 2010-12-12 07:54:08 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-12-12 07:54:08 +0100 |
commit | d720b43f8c75753e5ceed94c234688266786ba08 (patch) | |
tree | 5c70a8db025e737c979a558f30ef8cb46c766b88 /src/jogl/classes/com/jogamp | |
parent | 599e3eb630a59a9afbce45403c0567222e6065de (diff) |
makeCurrent/release within closures
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java index 38294bf4f..186bd5ec5 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java @@ -181,15 +181,16 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { throw new GLException("Couldn't create shared context for drawable: "+sharedDrawable); } sharedContext.setSynchronized(true); - sharedContext.makeCurrent(); VersionNumber glXVersion; - { + sharedContext.makeCurrent(); + try { int[] major = new int[1]; int[] minor = new int[1]; GLXUtil.getGLXVersion(sharedDevice.getHandle(), major, minor); glXVersion = new VersionNumber(major[0], minor[0], 0); + } finally { + sharedContext.release(); } - sharedContext.release(); if (DEBUG) { System.err.println("!!! SharedDevice: " + sharedDevice); System.err.println("!!! SharedScreen: " + sharedScreen); |