diff options
Diffstat (limited to 'src/net/java')
-rw-r--r-- | src/net/java/games/jogl/impl/x11/X11GLContext.java | 4 | ||||
-rw-r--r-- | src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java | 21 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/net/java/games/jogl/impl/x11/X11GLContext.java b/src/net/java/games/jogl/impl/x11/X11GLContext.java index 40e462fb3..359d0c95c 100644 --- a/src/net/java/games/jogl/impl/x11/X11GLContext.java +++ b/src/net/java/games/jogl/impl/x11/X11GLContext.java @@ -174,9 +174,7 @@ public abstract class X11GLContext extends GLContext { protected void destroyImpl() throws GLException { if (context != 0) { - if (!GLX.glXDestroyContext(mostRecentDisplay, context)) { - throw new GLException("Unable to delete OpenGL context"); - } + GLX.glXDestroyContext(mostRecentDisplay, context); if (DEBUG) { System.err.println("!!! Destroyed OpenGL context " + context); } diff --git a/src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java b/src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java index 0290f8d44..2aa85e9f8 100644 --- a/src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java +++ b/src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java @@ -167,14 +167,17 @@ public class X11OffscreenGLContext extends X11GLContext { isDoubleBuffered = (X11GLContextFactory.glXGetConfig(display, vis, GLX.GLX_DOUBLEBUFFER, new int[1]) != 0); } - private void destroy() { - // Must destroy OpenGL context, pixmap and GLXPixmap - GLX.glXDestroyContext(display, context); - GLX.glXDestroyGLXPixmap(display, (int) drawable); - GLX.XFreePixmap(display, pixmap); - context = 0; - drawable = 0; - pixmap = 0; - GLContextShareSet.contextDestroyed(this); + protected void destroyImpl() { + if (context != 0) { + super.destroyImpl(); + // Must destroy OpenGL context, pixmap and GLXPixmap + GLX.glXDestroyContext(display, context); + GLX.glXDestroyGLXPixmap(display, (int) drawable); + GLX.XFreePixmap(display, pixmap); + context = 0; + drawable = 0; + pixmap = 0; + GLContextShareSet.contextDestroyed(this); + } } } |