summaryrefslogtreecommitdiffstats
path: root/src/demos/testContextDestruction/TestContextDestruction.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/testContextDestruction/TestContextDestruction.java')
-rwxr-xr-xsrc/demos/testContextDestruction/TestContextDestruction.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/demos/testContextDestruction/TestContextDestruction.java b/src/demos/testContextDestruction/TestContextDestruction.java
index 3adb73c..2edff00 100755
--- a/src/demos/testContextDestruction/TestContextDestruction.java
+++ b/src/demos/testContextDestruction/TestContextDestruction.java
@@ -178,7 +178,12 @@ public class TestContextDestruction {
class Listener implements GLEventListener {
public void init(GLDrawable drawable) {
System.out.println("Listener.init()");
- drawable.setGL(new DebugGL(drawable.getGL()));
+ // init() might get called more than once if the GLCanvas is
+ // added and removed, but we only want to install the DebugGL
+ // pipeline once
+ if (!(drawable.getGL() instanceof DebugGL)) {
+ drawable.setGL(new DebugGL(drawable.getGL()));
+ }
GL gl = drawable.getGL();