Explorar o código

Fix array iterator when disposing an item

noalak %!s(int64=5) %!d(string=hai) anos
pai
achega
782fe74dff
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/Loading/sceneLoader.ts

+ 2 - 2
src/Loading/sceneLoader.ts

@@ -1063,7 +1063,7 @@ export class SceneLoader {
         });
         });
 
 
         // Copy animation groups
         // Copy animation groups
-        animationAssetContainer.animationGroups.forEach(animationGroupInAC => {
+        animationAssetContainer.animationGroups.slice().forEach(animationGroupInAC => {
             // Dispose animation groups with same name as one being loaded
             // Dispose animation groups with same name as one being loaded
             scene.animationGroups.forEach(animationGroup => {
             scene.animationGroups.forEach(animationGroup => {
                 if (animationGroup.name == animationGroupInAC.name) {
                 if (animationGroup.name == animationGroupInAC.name) {
@@ -1081,7 +1081,7 @@ export class SceneLoader {
         });
         });
 
 
         // Copy animatables
         // Copy animatables
-        scene.animatables.forEach(animatable => {
+        scene.animatables.slice().forEach(animatable => {
             let target = _targetConverter(animatable.target);
             let target = _targetConverter(animatable.target);
 
 
             // If the animatable has just been loaded
             // If the animatable has just been loaded