mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Merge default into minor
--HG-- branch : minor
This commit is contained in:
@@ -568,6 +568,16 @@ void World::destroy()
|
||||
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.
|
||||
b2Body *b = world->GetBodyList();
|
||||
while (b)
|
||||
@@ -585,13 +595,6 @@ void World::destroy()
|
||||
world->DestroyBody(groundBody);
|
||||
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;
|
||||
world = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user