aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-11-06 16:10:51 +0100
committerSven Gothel <[email protected]>2012-11-06 16:10:51 +0100
commitb83b068c0f426f24a58e2bd9f52de9ebd0c7876d (patch)
treeeba95025517c96d7adb83824dec247c77f506fdc /src/jogl/classes/jogamp
parent9e2563da5e40964d691fe9502de6c9178f98bee0 (diff)
Fix GLDrawableHelper.recreateGLDrawable(..): Sync GL command stream before destruction of drawable
Lack of finishing the GL command stream lead to a SIGSEGV on Windows w/ Nvidia driver where probably pending GL commands were still being processed concurrently.
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableHelper.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index be63c9278..36dc933ab 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -173,12 +173,17 @@ public class GLDrawableHelper {
if( ! drawable.isRealized() ) {
return drawable;
}
- final boolean contextCurrent = null != context && context.isCurrent();
+ final GLContext currentContext = GLContext.getCurrent();
final GLDrawableFactory factory = drawable.getFactory();
final NativeSurface surface = drawable.getNativeSurface();
final ProxySurface proxySurface = (surface instanceof ProxySurface) ? (ProxySurface)surface : null;
- if(contextCurrent) {
+ if( null != context ) {
+ // Ensure to sync GL command stream
+ if( currentContext != context ) {
+ context.makeCurrent();
+ }
+ context.getGL().glFinish();
context.release();
}
@@ -199,8 +204,8 @@ public class GLDrawableHelper {
context.setGLDrawable(drawable, true); // re-association
}
- if(contextCurrent) {
- context.makeCurrent();
+ if( null != currentContext ) {
+ currentContext.makeCurrent();
}
return drawable;
}