aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-12-12 07:54:08 +0100
committerSven Gothel <[email protected]>2010-12-12 07:54:08 +0100
commitd720b43f8c75753e5ceed94c234688266786ba08 (patch)
tree5c70a8db025e737c979a558f30ef8cb46c766b88 /src/jogl/classes
parent599e3eb630a59a9afbce45403c0567222e6065de (diff)
makeCurrent/release within closures
Diffstat (limited to 'src/jogl/classes')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java7
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);