mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fixed memory leaks in love.physics. When a World is garbage-collected it now implicitly calls World:destroy, which also destroys all Bodies, Fixtures, and Joints that belong to it.
This commit is contained in:
@@ -435,13 +435,9 @@ private:
|
||||
**/
|
||||
int pushVector(lua_State *L, const b2Vec2 &v);
|
||||
|
||||
// We need a shared_ptr to the parent World,
|
||||
// because World can not be destroyed as long as
|
||||
// bodies exists in it.
|
||||
//
|
||||
// This ensures that a World only can be destroyed
|
||||
// once all bodies have been destroyed too.
|
||||
StrongRef<World> world;
|
||||
// FIXME: This should be a weak reference, rather than being completely
|
||||
// unowned?
|
||||
World *world;
|
||||
|
||||
bodyudata *udata;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user