diff options
author | Sven Gothel <[email protected]> | 2014-03-17 20:42:44 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-03-17 20:42:44 +0100 |
commit | 5ff1300ddc9daadb885614462a769f6407487e59 (patch) | |
tree | c2b3bb07a4f5aaf4b1d67e07123f1f3a796443d7 /src | |
parent | f572da5aef6d0cb0731495254578a87e5b668a13 (diff) |
Graph: Fix NPE in case of double destroy call ..
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java | 23 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java | 21 |
2 files changed, 32 insertions, 12 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java index a760dcd33..6f9ef107b 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java @@ -88,12 +88,22 @@ public class VBORegion2PVBAAES2 extends GLRegion { @Override protected final void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) { - indicesTxtBuffer.seal(gl, false); - indicesTxtBuffer.rewind(); - verticeTxtAttr.seal(gl, false); - verticeTxtAttr.rewind(); - texCoordTxtAttr.seal(gl, false); - texCoordTxtAttr.rewind(); + if(DEBUG_INSTANCE) { + System.err.println("VBORegion2PES2 Clear: " + this); + // Thread.dumpStack(); + } + if( null != indicesTxtBuffer ) { + indicesTxtBuffer.seal(gl, false); + indicesTxtBuffer.rewind(); + } + if( null != verticeTxtAttr ) { + verticeTxtAttr.seal(gl, false); + verticeTxtAttr.rewind(); + } + if( null != texCoordTxtAttr ) { + texCoordTxtAttr.seal(gl, false); + texCoordTxtAttr.rewind(); + } } @Override @@ -387,6 +397,7 @@ public class VBORegion2PVBAAES2 extends GLRegion { protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) { if(DEBUG_INSTANCE) { System.err.println("VBORegion2PES2 Destroy: " + this); + // Thread.dumpStack(); } final ShaderState st = renderer.getShaderState(); if(null != fbo) { diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java index e45e623ba..baeb8dc46 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java @@ -57,12 +57,21 @@ public class VBORegionSPES2 extends GLRegion { @Override protected final void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) { - indicesBuffer.seal(gl, false); - indicesBuffer.rewind(); - verticeAttr.seal(gl, false); - verticeAttr.rewind(); - texCoordAttr.seal(gl, false); - texCoordAttr.rewind(); + if(DEBUG_INSTANCE) { + System.err.println("VBORegionSPES2 Clear: " + this); + } + if( null != indicesBuffer ) { + indicesBuffer.seal(gl, false); + indicesBuffer.rewind(); + } + if( null != verticeAttr ) { + verticeAttr.seal(gl, false); + verticeAttr.rewind(); + } + if( null != texCoordAttr ) { + texCoordAttr.seal(gl, false); + texCoordAttr.rewind(); + } } @Override |