fix: double-free due to calling super-destructor
This commit is contained in:
parent
b10abd3800
commit
9b51d85056
|
@ -24,8 +24,8 @@ Part::Part(PartConstructParams params): Instance(&TYPE_), position(params.positi
|
||||||
// This feels wrong. Get access to PhysicsWorld somehow else? Part will need access to this often though, most likely...
|
// This feels wrong. Get access to PhysicsWorld somehow else? Part will need access to this often though, most likely...
|
||||||
extern rp::PhysicsWorld* world;
|
extern rp::PhysicsWorld* world;
|
||||||
Part::~Part() {
|
Part::~Part() {
|
||||||
|
if (this->rigidBody)
|
||||||
world->destroyRigidBody(rigidBody);
|
world->destroyRigidBody(rigidBody);
|
||||||
Instance::~Instance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue