From 01f4e4290f0d093f164c83316bd884046c44494f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 2 Sep 2011 03:33:36 +0200 Subject: Test Gears ES1/ES2: Fix shared destruction --- .../opengl/test/junit/jogl/demos/GearsObject.java | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/test/com/jogamp/opengl') 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; -- cgit v1.2.3