Hi all,
I've discovered 2 apparent memory leaks when dealing with b2Controllers.
The first leak is due to a typo in b2World.DestroyBody line 208:
The second leak resides in b2Controller.RemoveBody line 59:
Either of these leaks will cause any body added to a controller to remain in memory once released with b2World.DestroyBody().
I hope this proves helpful.
Regards
niX
I've discovered 2 apparent memory leaks when dealing with b2Controllers.
The first leak is due to a typo in b2World.DestroyBody line 208:
Code:
var coe:b2ControllerEdge = b.m_controllerList;
while (ce) // <== this should be coe
{
var coe0:b2ControllerEdge = coe;
coe = coe.nextController;
coe0.controller.RemoveBody(b);
}
while (ce) // <== this should be coe
{
var coe0:b2ControllerEdge = coe;
coe = coe.nextController;
coe0.controller.RemoveBody(b);
}
The second leak resides in b2Controller.RemoveBody line 59:
Code:
var edge:b2ControllerEdge; // <== this should initialise to body.m_controllerList;
while (edge && edge.controller != this)
edge = edge.nextController;
while (edge && edge.controller != this)
edge = edge.nextController;
Either of these leaks will cause any body added to a controller to remain in memory once released with b2World.DestroyBody().
I hope this proves helpful.
Regards
niX