From 7140081033444abf95d2f8289eaa62ead41cf2e0 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 29 Aug 2015 19:41:10 +0200 Subject: *AnimatorImpl: Catch concurrent pulling of GLAutoDrawable instances It may happen that an GLAutoDrawable is being pulled concurrently from the animators list, in which case an IndexOutOfBoundsException might be thrown. Example: [junit] *** AWTRobotUtil: UncaughtException (this Thread main-AWTAnimator#00) : Thread , java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 [junit] java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 [junit] at java.util.ArrayList.rangeCheck(ArrayList.java:653) [junit] at java.util.ArrayList.get(ArrayList.java:429) [junit] at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:68) [junit] at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:451) [junit] at com.jogamp.opengl.util.Animator$MainLoop.run(Animator.java:198) [junit] at java.lang.Thread.run(Thread.java:745) --- .../classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java') diff --git a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java index 6cded29d9..d8c8465d9 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java @@ -48,12 +48,19 @@ class DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl { public void display(final ArrayList drawables, final boolean ignoreExceptions, final boolean printExceptions) throws UncaughtAnimatorException { - for (int i=0; i