before destroy make sure the body is deactive (#4656)

This commit is contained in:
jiaxin.lai
2019-06-20 09:35:15 +08:00
committed by Weiliang Wang
parent 01d25588e7
commit 280e620f64
@@ -271,6 +271,9 @@ class SharedRigidBody {
}
public destroy () {
// before destroy make sure body is deactive
this._deactiveBody();
this._body.setUserData(null);
(this._body as any) = null;
(this._beforeStepCallback as any) = null;