From bc01b42ca3cad33808ee2255628deadc49c04ef2 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 11 Aug 2006 23:15:53 +0000 Subject: Fixed crash triggered by Java 3D's JoglPipeline in off-screen rendering on X11 platforms by watching for destruction of the pbuffer out from under an application-created context; could do better by explicitly destroying all application-created contexts in the shared code for both the GLCanvas and GLPbufferImpl (and probably the GLJPanel too) git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@881 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/x11/X11PbufferGLContext.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/classes/com/sun') diff --git a/src/classes/com/sun/opengl/impl/x11/X11PbufferGLContext.java b/src/classes/com/sun/opengl/impl/x11/X11PbufferGLContext.java index 5ff3bd86c..4207c7d99 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11PbufferGLContext.java +++ b/src/classes/com/sun/opengl/impl/x11/X11PbufferGLContext.java @@ -110,6 +110,10 @@ public class X11PbufferGLContext extends X11GLContext { protected void releaseImpl() throws GLException { lockToolkit(); try { + if (drawable.getDisplay() == 0) { + throw new GLException("Pbuffer destroyed out from under application-created context"); + } + if (!GLX.glXMakeContextCurrent(drawable.getDisplay(), 0, 0, 0)) { throw new GLException("Error freeing OpenGL context"); } -- cgit v1.2.3