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:
2015-08-16 11:38:25 +02:00
parent 19cc75d642
commit 9437acb7f3
6 changed files with 32 additions and 28 deletions

View File

@@ -106,7 +106,7 @@ int DummyPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ct
}
void DummyPhysicsEnvironment::RemoveConstraint(int constraintid)
void DummyPhysicsEnvironment::RemoveConstraintById(int constraintid)
{
if (constraintid)
{