mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Merge default into minor
--HG-- branch : minor
This commit is contained in:
@@ -568,6 +568,16 @@ void World::destroy()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove userdata reference to avoid it sticking around after GC
|
||||||
|
if (begin.ref) begin.ref->unref();
|
||||||
|
if (end.ref) end.ref->unref();
|
||||||
|
if (presolve.ref) presolve.ref->unref();
|
||||||
|
if (postsolve.ref) postsolve.ref->unref();
|
||||||
|
if (filter.ref) filter.ref->unref();
|
||||||
|
|
||||||
|
//disable callbacks
|
||||||
|
begin.ref = end.ref = presolve.ref = postsolve.ref = filter.ref = nullptr;
|
||||||
|
|
||||||
// Cleaning up the world.
|
// Cleaning up the world.
|
||||||
b2Body *b = world->GetBodyList();
|
b2Body *b = world->GetBodyList();
|
||||||
while (b)
|
while (b)
|
||||||
@@ -585,13 +595,6 @@ void World::destroy()
|
|||||||
world->DestroyBody(groundBody);
|
world->DestroyBody(groundBody);
|
||||||
Memoizer::remove(world);
|
Memoizer::remove(world);
|
||||||
|
|
||||||
// Remove userdata reference to avoid it sticking around after GC
|
|
||||||
if (begin.ref) begin.ref->unref();
|
|
||||||
if (end.ref) end.ref->unref();
|
|
||||||
if (presolve.ref) presolve.ref->unref();
|
|
||||||
if (postsolve.ref) postsolve.ref->unref();
|
|
||||||
if (filter.ref) filter.ref->unref();
|
|
||||||
|
|
||||||
delete world;
|
delete world;
|
||||||
world = nullptr;
|
world = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user