summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-02 07:05:11 +0200
committerSven Gothel <[email protected]>2013-09-02 07:05:11 +0200
commit32171ee45370a9c6dacb582c39d51d0ff17911f1 (patch)
tree45c122f8fdb6912f91931774dcc0b31bafd201e9 /src
parent43cc2ea7529f92068ec3645e87e439f129fec99b (diff)
Animator/GLWindow: Catch 'ThreadDeath/Throwable' and dump info in DEBUG mode (cosmetic change only); Typo in comment; TestSharedContextListNEWT2: Stop animator.
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/Animator.java5
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java17
4 files changed, 21 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index ac2b24117..80d980492 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -201,6 +201,11 @@ public class Animator extends AnimatorBase {
Thread.yield();
}
}
+ } catch( ThreadDeath td) {
+ if(DEBUG) {
+ System.err.println("Animator Catched: "+td.getClass().getName()+": "+td.getMessage());
+ td.printStackTrace();
+ }
} finally {
if( exclusiveContext && !drawablesEmpty ) {
setDrawablesExclCtxState(false);
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index 52069b88f..91beddb02 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -337,7 +337,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
if (null != sr.context) {
// may cause JVM SIGSEGV:
- sr.context.destroy(); // will also pull the dummy MutuableSurface
+ sr.context.destroy(); // will also pull the dummy MutableSurface
sr.context = null;
}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 30c51218b..45ab2a44c 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -553,6 +553,10 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
try {
animThread.stop();
} catch(Throwable t) {
+ if( DEBUG ) {
+ System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+ t.printStackTrace();
+ }
}
}
return null;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
index 6b1da870a..0d1f58c1e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
@@ -118,12 +118,13 @@ public class TestSharedContextListNEWT2 extends UITestCase {
@Test(timeout=10000)
public void test01() throws InterruptedException {
initShared();
- GLWindow f1 = runTestGL(new Animator(), 0, 0, true, false);
- InsetsImmutable insets = f1.getInsets();
- GLWindow f2 = runTestGL(new Animator(), f1.getX()+width+insets.getTotalWidth(),
- f1.getY()+0, true, false);
- GLWindow f3 = runTestGL(new Animator(), f1.getX()+0,
- f1.getY()+height+insets.getTotalHeight(), true, false);
+
+ final GLWindow f1 = runTestGL(new Animator(), 0, 0, true, false);
+ final InsetsImmutable insets = f1.getInsets();
+ final GLWindow f2 = runTestGL(new Animator(), f1.getX()+width+insets.getTotalWidth(),
+ f1.getY()+0, true, false);
+ final GLWindow f3 = runTestGL(new Animator(), f1.getX()+0,
+ f1.getY()+height+insets.getTotalHeight(), true, false);
try {
Thread.sleep(duration);
@@ -134,6 +135,10 @@ public class TestSharedContextListNEWT2 extends UITestCase {
f1.destroy();
f2.destroy();
f3.destroy();
+
+ f1.getAnimator().stop();
+ f2.getAnimator().stop();
+ f3.getAnimator().stop();
releaseShared();
}