Browse Source

Merge pull request #435 from Palmer-JC/master

Geometry disposal detection
David Catuhe 10 years ago
parent
commit
2fc3277b03
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Babylon/Mesh/babylon.geometry.ts

+ 6 - 0
Babylon/Mesh/babylon.geometry.ts

@@ -12,6 +12,7 @@
         private _totalVertices = 0;
         private _indices = [];
         private _vertexBuffers;
+        private _isDisposed = false;
         public _delayInfo; //ANY
         private _indexBuffer;
         public _boundingInfo: BoundingInfo;
@@ -350,6 +351,10 @@
             }, () => { }, scene.database);
         }
 
+        public isDisposed(): boolean {
+            return this._isDisposed;
+        }
+
         public dispose(): void {
             var meshes = this._meshes;
             var numOfMeshes = meshes.length;
@@ -384,6 +389,7 @@
             if (index > -1) {
                 geometries.splice(index, 1);
             }
+            this._isDisposed = true;
         }
 
         public copy(id: string): Geometry {