aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun/opengl/impl')
-rw-r--r--src/classes/com/sun/opengl/impl/x11/X11PbufferGLContext.java4
1 files changed, 4 insertions, 0 deletions
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");
}