Browse Source

replacing for...in by forEach to avoid bug when using BJS inside complex frameworks

Vousk-prod 10 years ago
parent
commit
8bee6168f7
1 changed files with 5 additions and 4 deletions
  1. 5 4
      Babylon/Rendering/babylon.renderingManager.ts

+ 5 - 4
Babylon/Rendering/babylon.renderingManager.ts

@@ -90,10 +90,11 @@
         }
 
         public reset(): void {
-            for (var index in this._renderingGroups) {
-                var renderingGroup = this._renderingGroups[index];
-                renderingGroup.prepare();
-            }
+            this._renderingGroups.forEach( function(renderingGroup, index, array) {
+                if (renderingGroup) {
+                    renderingGroup.prepare();
+                }
+            });
         }
 
         public dispatch(subMesh: SubMesh): void {