diff options
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index f2016a23c..265c7ff49 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -347,10 +347,17 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { } if(null!=context) { - boolean animatorWasAnimating = false; + boolean animatorPaused = false; GLAnimatorControl animator = getAnimator(); if(null!=animator) { - animatorWasAnimating = animator.isAnimating(); + if(regenerate) { + if(animator.isStarted() && !animator.isPaused()) { + animator.pause(); + animatorPaused = true; + } + } else { + animator.remove(this); + } } disposeRegenerate=regenerate; @@ -376,8 +383,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { drawableHelper.invokeGL(drawable, context, disposeAction, null); } - if(regenerate && animatorWasAnimating && animator.isPaused()) { - animator.resume(); + if(animatorPaused) { + animator.resume(); } } if(!regenerate) { |