From 99d205d0c5f047ef9a6a6e21f351abe415ed3b15 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 28 Oct 2010 01:24:58 +0200 Subject: Animator Fix/Cleanup - Fix AnimatorBase: Finally using 'com.jogamp.opengl.util.AWTAnimatorImpl', wrong FQN lead to never use it, hence deadlock in case of AWT usage (AWT-EDT). - Animator - remove volatile for synced state isAnimated - new state isPaused, since shouldPause give the wrong answer for isPaused() - Cleanup wait condition for lifecycle tasks (start/stop/pause/resume) - 'AnimatorImpl' -> 'DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl' - 'AWTAnimatorImpl implements AnimatorBase.AnimatorImpl', hence no derivation of a complete overwritten AnimatorImpl needed. - GLWindow.destroyActionPreLock() - Stop animator if unrecoverable, else pause only. Tests: - No explicit animator stop, hence tests implicit stop/pause by GLDrawableHelper and/or GLWindow. --- src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/newt') diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index f6901e54a..7836bec68 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -280,10 +280,14 @@ public class GLWindow implements GLAutoDrawable, Window { /** Window.LifecycleHook */ public synchronized void destroyActionPreLock(boolean unrecoverable) { GLAnimatorControl animator = GLWindow.this.getAnimator(); - // since we have no 'recreation model' for dispose here yet, - // we simply stop the animator if started. - if(null!=animator && animator.isStarted()) { - animator.stop(); + if(null!=animator) { + if(unrecoverable) { + if(animator.isStarted()) { + animator.stop(); + } + } else if(animator.isAnimating()) { + animator.pause(); + } } } -- cgit v1.2.3