浏览代码

Fixed instance.dispose bug

David Catuhe 8 年之前
父节点
当前提交
e8825ae1d5

文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/babylon.core.js


文件差异内容过多而无法显示
+ 4949 - 4949
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/babylon.js


+ 5 - 4
dist/preview release/babylon.max.js

@@ -11455,9 +11455,10 @@ var BABYLON;
                 this._edgesRenderer = null;
             }
             // SubMeshes
-            this.releaseSubMeshes();
+            if (this.getClassName() !== "InstancedMesh") {
+                this.releaseSubMeshes();
+            }
             // Engine
-            this.getScene().getEngine().unbindAllAttributes();
             this.getScene().getEngine().wipeCaches();
             // Remove from scene
             this.getScene().removeMesh(this);
@@ -19927,7 +19928,7 @@ var BABYLON;
             result.computeWorldMatrix(true);
             return result;
         };
-        // Dispoe
+        // Dispose
         InstancedMesh.prototype.dispose = function (doNotRecurse) {
             // Remove from mesh
             var index = this._sourceMesh.instances.indexOf(this);
@@ -52217,7 +52218,7 @@ var BABYLON;
     })(Internals = BABYLON.Internals || (BABYLON.Internals = {}));
 })(BABYLON || (BABYLON = {}));
 
-//# sourceMappingURL=babylon.tools.pmremgenerator.js.map
+//# sourceMappingURL=babylon.tools.pmremGenerator.js.map
 
 
 

文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/babylon.noworker.js


+ 3 - 2
src/Mesh/babylon.abstractMesh.ts

@@ -1171,10 +1171,11 @@
             }
 
             // SubMeshes
-            this.releaseSubMeshes();
+            if (this.getClassName() !== "InstancedMesh"){
+                this.releaseSubMeshes();
+            }
 
             // Engine
-            this.getScene().getEngine().unbindAllAttributes();
             this.getScene().getEngine().wipeCaches();
 
             // Remove from scene

+ 1 - 1
src/Mesh/babylon.instancedMesh.ts

@@ -153,7 +153,7 @@
             return result;
         }
 
-        // Dispoe
+        // Dispose
         public dispose(doNotRecurse?: boolean): void {
 
             // Remove from mesh