Browse Source

Early out on initializePending and terminatePending
if the array is empty.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9233 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

PSp..om 13 years ago
parent
commit
2bde71b08a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      engine/src/core/com/jme3/app/state/AppStateManager.java

+ 6 - 0
engine/src/core/com/jme3/app/state/AppStateManager.java

@@ -202,6 +202,9 @@ public class AppStateManager {
 
 
     protected void initializePending(){
     protected void initializePending(){
         AppState[] array = getInitializing();
         AppState[] array = getInitializing();
+        if (array.length == 0)
+            return;
+            
         synchronized( states ) {
         synchronized( states ) {
             // Move the states that will be initialized
             // Move the states that will be initialized
             // into the active array.  In all but one case the
             // into the active array.  In all but one case the
@@ -219,6 +222,9 @@ public class AppStateManager {
     
     
     protected void terminatePending(){
     protected void terminatePending(){
         AppState[] array = getTerminating();
         AppState[] array = getTerminating();
+        if (array.length == 0)
+            return;
+            
         for (AppState state : array) {
         for (AppState state : array) {
             state.cleanup();
             state.cleanup();
         }        
         }