Skip to content
Browse files

Fix for skipping Runnables in RunnableHandler

Runnables added to mRunnables while walking through mRunnables list
where never run.
  • Loading branch information...
1 parent e6df5e8 commit 4ee68dc881566d36c1fdada6c979d4642e26cd98 @nazgee nazgee committed Jun 8, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/org/andengine/engine/handler/runnable/RunnableHandler.java
View
3 src/org/andengine/engine/handler/runnable/RunnableHandler.java
@@ -39,9 +39,8 @@ public synchronized void onUpdate(final float pSecondsElapsed) {
final ArrayList<Runnable> runnables = this.mRunnables;
final int runnableCount = runnables.size();
for(int i = runnableCount - 1; i >= 0; i--) {
- runnables.get(i).run();
+ runnables.remove(i).run();
}
- runnables.clear();
}
@Override

0 comments on commit 4ee68dc

Please sign in to comment.
Something went wrong with that request. Please try again.