Fix a leak on destruction of a physics world

This commit is contained in:
Bart van Strien
2012-01-24 23:00:18 +01:00
parent 94bd960cc7
commit a67b5b501f
+3 -6
View File
@@ -234,12 +234,6 @@ namespace box2d
world->Step(dt, 8, 6);
// Destroy all objects marked during the time step.
if (destructWorld)
{
destroy();
return;
}
for (std::vector<Body*>::iterator i = destructBodies.begin(); i < destructBodies.end(); i++)
{
Body * b = *i;
@@ -264,6 +258,9 @@ namespace box2d
destructBodies.clear();
destructFixtures.clear();
destructJoints.clear();
if (destructWorld)
destroy();
}
void World::BeginContact(b2Contact* contact)