浏览代码

Do not init if impostor is disposed.

Raanan Weber 7 年之前
父节点
当前提交
b3893bc2c5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Physics/babylon.physicsImpostor.ts

+ 1 - 1
src/Physics/babylon.physicsImpostor.ts

@@ -157,7 +157,7 @@ module BABYLON {
             this._physicsEngine.removeImpostor(this);
             this.physicsBody = null;
             this._parent = this._parent || this._getPhysicsParent();
-            if (!this.parent || this._options.ignoreParent) {
+            if (!this._isDisposed && (!this.parent || this._options.ignoreParent)) {
                 this._physicsEngine.addImpostor(this);
             }
         }