diff options
author | Kenneth Russel <[email protected]> | 2006-04-19 23:48:50 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-04-19 23:48:50 +0000 |
commit | d8348ee3761bc8f05c11043a96a90d67c85bd867 (patch) | |
tree | 26fa7fbba8370a92d30c794b2dbd9b1b6743b484 /src/classes/javax/media/opengl/GLCanvas.java | |
parent | fe68b4b40a382cbf8b89619fcf747d5886d4118f (diff) |
Added detection to JOGLAppletLauncher of whether DRIHack library is
present even if we didn't just download the native library jar. Worked
around deadlocks during termination of JOGL applets caused by new code
which causes context destruction to be performed on the AWT event
queue thread (more correct, but problematic with buggy code such as
sun.applet.AppletPanel which performs remove() calls on current
thread).
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@729 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media/opengl/GLCanvas.java')
-rw-r--r-- | src/classes/javax/media/opengl/GLCanvas.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/classes/javax/media/opengl/GLCanvas.java b/src/classes/javax/media/opengl/GLCanvas.java index 979c466c2..83072ffc5 100644 --- a/src/classes/javax/media/opengl/GLCanvas.java +++ b/src/classes/javax/media/opengl/GLCanvas.java @@ -169,7 +169,18 @@ public class GLCanvas extends Canvas implements GLAutoDrawable { try { if (Threading.isSingleThreaded() && !Threading.isOpenGLThread()) { - Threading.invokeOnOpenGLThread(destroyAction); + // Workaround for termination issues with applets -- + // sun.applet.AppletPanel should probably be performing the + // remove() call on the EDT rather than on its own thread + if (Threading.isAWTMode() && + Thread.holdsLock(getTreeLock())) { + // The user really should not be invoking remove() from this + // thread -- but since he/she is, we can not go over to the + // EDT at this point. Try to destroy the context from here. + destroyAction.run(); + } else { + Threading.invokeOnOpenGLThread(destroyAction); + } } else { destroyAction.run(); } |