summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLPbufferImpl.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLPbufferImpl.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
index e785d5734..ae83965e9 100644
--- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
@@ -42,6 +42,8 @@ package jogamp.opengl;
import com.jogamp.common.util.locks.LockFactory;
import com.jogamp.common.util.locks.RecursiveLock;
+
+import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.nativewindow.NativeSurface;
import javax.media.opengl.GL;
import javax.media.opengl.GLAnimatorControl;
@@ -107,6 +109,8 @@ public class GLPbufferImpl implements GLPbuffer {
public void destroy() {
if(pbufferDrawable.isRealized()) {
+ final AbstractGraphicsDevice adevice = pbufferDrawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+
if (null != context && context.isCreated()) {
try {
drawableHelper.invokeGL(pbufferDrawable, context, disposeAction, null);
@@ -117,6 +121,10 @@ public class GLPbufferImpl implements GLPbuffer {
// drawableHelper.reset();
}
pbufferDrawable.destroy();
+
+ if(null != adevice) {
+ adevice.close();
+ }
}
}