mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Fix a leak on destruction of a physics world
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user