summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java
index e011d271b..977e3315c 100644
--- a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java
+++ b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java
@@ -77,12 +77,24 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext {
}
return ret;
} finally {
- if (lockRes != MacOSXOnscreenGLDrawable.LOCK_SURFACE_NOT_READY) {
- drawable.unlockSurface();
+ if (optimizationEnabled) {
+ if (lockRes != MacOSXOnscreenGLDrawable.LOCK_SURFACE_NOT_READY) {
+ drawable.unlockSurface();
+ }
}
}
}
+ protected void releaseImpl() throws GLException {
+ if (!optimizationEnabled) {
+ try {
+ super.releaseImpl();
+ } finally {
+ drawable.unlockSurface();
+ }
+ }
+ }
+
public void swapBuffers() throws GLException {
if (!CGL.flushBuffer(nsContext)) {
throw new GLException("Error swapping buffers");