Hi, I've come across a Memory Leak in box2d 2.1a flash version. Was wondering if anyone is still supporting it, or knows their way around the code enough to recomend a fix for it. or could let me know if there is a more up to date version i should be using ?.
The leak occurs when the following conditions occur.
A B2PolygonShape is created and added to the world.
A B2CircleShape is created and added to the world.
These two body's colide.
Both shapes are destroyed from the world using world.DestroyBody(body)
The specifics of the leak are that after this behaviour has occured, the body of the B2CircleShape remains in memory and isn't garbage collected by flash (along with a multitude of additional box2d classes according to the profiler, one of which i expect is the actual cause of the problem if it is referencing the Circle's body).
This only occurs to the B2CircleShape's body, and only once it has collided with a B2PolygonShape whilst it was in the world. If the B2CircleShape is destroyed before it colides with any other body, or after it has collided with other B2CircleShapes, then it's body is garbage collected correctly and memory is freed. If the B2PolygonShape which the B2CircleShape collided with is destroyed, the polygon is garbage collected correctly, but this has no effect of the garbage collection of the B2CircleShape's body which remains in memory.
If anyone knows how to rectify this behaviour, or can explain how collisions between polygon's and circles are handled within this version of Box2d it would be a great help.
The leak occurs when the following conditions occur.
A B2PolygonShape is created and added to the world.
A B2CircleShape is created and added to the world.
These two body's colide.
Both shapes are destroyed from the world using world.DestroyBody(body)
The specifics of the leak are that after this behaviour has occured, the body of the B2CircleShape remains in memory and isn't garbage collected by flash (along with a multitude of additional box2d classes according to the profiler, one of which i expect is the actual cause of the problem if it is referencing the Circle's body).
This only occurs to the B2CircleShape's body, and only once it has collided with a B2PolygonShape whilst it was in the world. If the B2CircleShape is destroyed before it colides with any other body, or after it has collided with other B2CircleShapes, then it's body is garbage collected correctly and memory is freed. If the B2PolygonShape which the B2CircleShape collided with is destroyed, the polygon is garbage collected correctly, but this has no effect of the garbage collection of the B2CircleShape's body which remains in memory.
If anyone knows how to rectify this behaviour, or can explain how collisions between polygon's and circles are handled within this version of Box2d it would be a great help.