소스 검색

Bug fix

Fixed a bug removing the last mesh of the scene graph if this mesh is already disposed.
This bug can be reproduced here : http://www.babylonjs.com/playground/#20DP3L
Temechon 11 년 전
부모
커밋
491091a083
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      Babylon/Mesh/babylon.abstractMesh.ts

+ 5 - 2
Babylon/Mesh/babylon.abstractMesh.ts

@@ -743,7 +743,10 @@
 
             // Remove from scene
             var index = this.getScene().meshes.indexOf(this);
-            this.getScene().meshes.splice(index, 1);
+            if (index != -1){
+                // Remove from the scene if mesh found
+                this.getScene().meshes.splice(index, 1);
+            }
 
             if (!doNotRecurse) {
                 // Particles
@@ -779,4 +782,4 @@
             }
         }
     }
-}
+}