mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +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:
@@ -40,7 +40,7 @@ namespace box2d
|
||||
{
|
||||
|
||||
Joint::Joint(Body *body1)
|
||||
: world(body1->world.get())
|
||||
: world(body1->world)
|
||||
, udata(nullptr)
|
||||
, body1(body1)
|
||||
, body2(nullptr)
|
||||
@@ -50,7 +50,7 @@ Joint::Joint(Body *body1)
|
||||
}
|
||||
|
||||
Joint::Joint(Body *body1, Body *body2)
|
||||
: world(body1->world.get())
|
||||
: world(body1->world)
|
||||
, udata(nullptr)
|
||||
, body1(body1)
|
||||
, body2(body2)
|
||||
|
||||
Reference in New Issue
Block a user