From 657081451f7cceac0b0a58b3c15a10a6d3b4b907 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 22 Sep 2014 07:07:42 +0200 Subject: Stabilize, fix regression: GLDrawable.invoke(..) and Animator* display-loop 'closure' GLDrawable.invoke(..) regression of commit c77b8f586cb2553582a42f5b90aeee5ef85f1efe: 'wait' was not set to false, if 'deferredHere' was forced to 'false'. This could lead to the situation where GLRunnableTask will catch the exception and supresses it. Animator/FPSAnimator post exception propagation code animThread = null; notifyAll(); must be complete to finalize animator state in case of an exception. Decorate 'handleUncaughtException(..)' w/ try { } finally { } where the latter ensures the mentioned 'closure'. --- src/jogl/classes/com/jogamp/opengl/util/Animator.java | 11 +++++++---- src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src/jogl/classes/com') diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java index 4d61adaa6..c7a03eddb 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java +++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java @@ -237,11 +237,14 @@ public class Animator extends AnimatorBase { stopIssued = false; pauseIssued = false; isAnimating = false; - if( null != displayCaught ) { - handleUncaughtException(displayCaught); + try { + if( null != displayCaught ) { + handleUncaughtException(displayCaught); // may throw exception if null handler + } + } finally { + animThread = null; + Animator.this.notifyAll(); } - animThread = null; - Animator.this.notifyAll(); } } } diff --git a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java index ec6c8aae7..dc4a9a896 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java +++ b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java @@ -232,11 +232,14 @@ public class FPSAnimator extends AnimatorBase { } } isAnimating = false; - if( null != displayCaught ) { - handleUncaughtException(displayCaught); + try { + if( null != displayCaught ) { + handleUncaughtException(displayCaught); // may throw exception if null handler + } + } finally { + animThread = null; + FPSAnimator.this.notifyAll(); } - animThread = null; - FPSAnimator.this.notifyAll(); } } } -- cgit v1.2.3