From 802404e08476387f656115b8542366706d7eeb3f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 11 Nov 2012 08:55:28 +0100 Subject: Fix Graph SceneUIController: Remove Listener by itself in dispose() --- .../jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java | 5 ++--- .../jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java index eaac2b1bf..f43a933e4 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java @@ -267,9 +267,8 @@ public class GPUUISceneGLListener0A implements GLEventListener { } else { System.err.println("GPUUISceneGLListener0A: dispose (0)"); } - - drawable.removeGLEventListener(sceneUIController); - sceneUIController.dispose(drawable); + + // sceneUIController will remove itself from the drawable! GL2ES2 gl = drawable.getGL().getGL2ES2(); regionRenderer.destroy(gl); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java index c6d43480a..616dd9b98 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java @@ -100,6 +100,7 @@ public class SceneUIController implements GLEventListener{ public void dispose(GLAutoDrawable drawable) { System.err.println("SceneUIController: dispose"); cDrawable = null; + drawable.removeGLEventListener(this); } public void reshape(GLAutoDrawable drawable, int x, int y, int width, -- cgit v1.2.3