From d23b08203e32f8f50991a48132eb3c2236b4efc0 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 13 Jan 2012 11:43:35 +0100 Subject: OSX Fix: Catch releaseImpl's glFinish() exception (DebugGL); Make GLContext.release's setCurrent(null) exception prone. Catch releaseImpl's glFinish() exception (DebugGL) glGetError() after glFinish() (eg. w/ debug pipeline) produced unknown error 0x0506 on OS X (10.7.2 NV). Make GLContext.release's setCurrent(null) exception prone Call setCurrent(null) in finalizer block to ensure it's 'released' out of the TLS even when an exception is being thrown. Make MacOSX Shared Resources 'destroy' more error prone (catch exceptions) --- src/jogl/classes/javax/media/opengl/GLContext.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/javax/media') diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index 8626400f7..131f42e06 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -69,7 +69,8 @@ import jogamp.opengl.GLContextImpl; refer to a given context. */ public abstract class GLContext { public static final boolean DEBUG = Debug.debug("GLContext"); - + + public static final boolean TRACE_SWITCH; /** Reflects property jogl.debug.DebugGL. If true, the debug pipeline is enabled at context creation. */ public final static boolean DEBUG_GL; /** Reflects property jogl.debug.TraceGL. If true, the trace pipeline is enabled at context creation. */ @@ -79,6 +80,7 @@ public abstract class GLContext { final AccessControlContext acl = AccessController.getContext(); DEBUG_GL = Debug.isPropertyDefined("jogl.debug.DebugGL", true, acl); TRACE_GL = Debug.isPropertyDefined("jogl.debug.TraceGL", true, acl); + TRACE_SWITCH = Debug.isPropertyDefined("jogl.debug.GLContext.TraceSwitch", true, acl); } /** Indicates that the context was not made current during the last call to {@link #makeCurrent makeCurrent}. */ @@ -295,6 +297,9 @@ public abstract class GLContext { * new GLContext implementations; not for use by end users. */ protected static void setCurrent(GLContext cur) { + if(TRACE_SWITCH) { + System.err.println("GLContext.ContextSwitch: - setCurrent() - "+Thread.currentThread().getName()+": "+cur); + } currentContext.set(cur); } -- cgit v1.2.3