BGE: Fix memory leak and crash with certain physic types
Fixing crash if the physic type is set sensor or character. Caused by a790e172d0.
Fixing memory leak, if the constraint is deleted with Python API removeConstraint().
Add RemoveConstraint() method to avoid code duplication.
Rename old RemoveConstraint() to RemoveConstraintById() which is more suitable name for this method.
This commit is contained in:
@@ -106,7 +106,7 @@ int DummyPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ct
|
||||
|
||||
}
|
||||
|
||||
void DummyPhysicsEnvironment::RemoveConstraint(int constraintid)
|
||||
void DummyPhysicsEnvironment::RemoveConstraintById(int constraintid)
|
||||
{
|
||||
if (constraintid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user