diff options
author | Sven Gothel <[email protected]> | 2011-09-02 03:33:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-02 03:33:36 +0200 |
commit | 01f4e4290f0d093f164c83316bd884046c44494f (patch) | |
tree | 57aac78df2d14e43bd985a1001e388177e92b41b | |
parent | a14998effa6b071b79b04a5e72622aff09be8911 (diff) |
Test Gears ES1/ES2: Fix shared destruction
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java index d73c7f735..b098e1de9 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java @@ -51,12 +51,25 @@ public abstract class GearsObject { public void destroy(GL gl) { if(!isShared) { - frontFace.destroy(gl); - frontSide.destroy(gl); - backFace.destroy(gl); - backSide.destroy(gl); - outwardFace.destroy(gl); - insideRadiusCyl.destroy(gl); + // could be already destroyed by shared configuration + if(null != frontFace) { + frontFace.destroy(gl); + } + if(null != frontSide) { + frontSide.destroy(gl); + } + if(null != backFace) { + backFace.destroy(gl); + } + if(null != backSide) { + backSide.destroy(gl); + } + if(null != outwardFace) { + outwardFace.destroy(gl); + } + if(null != insideRadiusCyl) { + insideRadiusCyl.destroy(gl); + } } frontFace=null; frontSide=null; |