diff options
author | Sven Gothel <[email protected]> | 2009-10-15 00:24:36 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-10-15 00:24:36 -0700 |
commit | 1d2e9cdca89e83339814abff38790367b33e6523 (patch) | |
tree | 18eb8ae9eeb74e95d47ef7c6fed7774a37783370 /src/jogl/classes | |
parent | 545e4cd38f00d2f11153b0025fac51eed8cef797 (diff) |
Fix Solaris build
Diffstat (limited to 'src/jogl/classes')
-rw-r--r-- | src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java index 2bc6660fb..c324b1ce1 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java @@ -81,20 +81,22 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { public void destroy() { NativeWindow nw = getNativeWindow(); - if (nw.getSurfaceHandle() != 0) { - // Must release DC and pbuffer - // NOTE that since the context is not current, glGetError() can - // not be called here, so we skip the use of any composable - // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl) - WGLExt wglExt = cachedWGLExt; - if (wglExt.wglReleasePbufferDCARB(buffer, nw.getSurfaceHandle()) == 0) { - throw new GLException("Error releasing pbuffer device context: error code " + WGL.GetLastError()); - } - ((SurfaceChangeable)nw).setSurfaceHandle(0); - if (!wglExt.wglDestroyPbufferARB(buffer)) { - throw new GLException("Error destroying pbuffer: error code " + WGL.GetLastError()); - } - buffer = 0; + if(0!=buffer) { + WGLExt wglExt = cachedWGLExt; + if (nw.getSurfaceHandle() != 0) { + // Must release DC and pbuffer + // NOTE that since the context is not current, glGetError() can + // not be called here, so we skip the use of any composable + // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl) + if (wglExt.wglReleasePbufferDCARB(buffer, nw.getSurfaceHandle()) == 0) { + throw new GLException("Error releasing pbuffer device context: error code " + WGL.GetLastError()); + } + ((SurfaceChangeable)nw).setSurfaceHandle(0); + } + if (!wglExt.wglDestroyPbufferARB(buffer)) { + throw new GLException("Error destroying pbuffer: error code " + WGL.GetLastError()); + } + buffer = 0; } } |