From d720b43f8c75753e5ceed94c234688266786ba08 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 12 Dec 2010 07:54:08 +0100 Subject: makeCurrent/release within closures --- .../com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/com') 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); -- cgit v1.2.3