yoshinoToylogic / bulletsharp

Automatically exported from code.google.com/p/bulletsharp
MIT License
0 stars 0 forks source link

Memory leak in CollisionWorld.RayTest #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a DiscreetDynamicsWorld with one static rigid body
2. Repeatedly run World.RayTest(a, b, callback), creating a new 
AllHitsRayResultCallback for each test.

What is the expected output? What do you see instead?
RayTest works fine, but task manager shows that ram usage increases by about a 
megabyte every one or two seconds. This does not happen when I don't do the ray 
test and not create the AllHitsRayResultCallback.

What version of the product are you using? On what operating system?
BulletSharp 2.80.0.0, OpenTK 1.0.0.0, Windows 7 64bit

Please provide any additional information below.
Also seems to happen if I just create the AllHitsRayResult without running the 
RayTest. Also happens when I run RayTest repeatedly with the same 
AllHitsRayResult. Maybe multiple separate leaks there...

Original issue reported on code.google.com by hazard...@gmail.com on 25 Jun 2012 at 5:29

GoogleCodeExporter commented 8 years ago
As a temporary measure, some classes don't clean up the unmanaged object when 
Dispose is called. This is to avoid the unwanted side-effect of deleting an 
object which is still referenced by the world. All such classes should really 
be reviewed and fixed, but I haven't got around to doing it yet. There aren't 
very many though.

I fixed the leak in RayResultCallback in r390. RayResultCallback is only 
referenced during the RayTest, so it's safe to delete.

I'm not sure why it would keep leaking if only one AllHitsRayResult is used, 
because RayTest itself seems to be fine.

Original comment by andres.traks on 25 Jun 2012 at 10:44

GoogleCodeExporter commented 8 years ago
Thanks for the quick reply. I'll have a look and see whether that fixed my 
problem.

Original comment by hazard...@gmail.com on 26 Jun 2012 at 12:04

GoogleCodeExporter commented 8 years ago
Sorry I haven't replied after testing. The new version has solved the issue. 
Thank you!

Original comment by hazard...@gmail.com on 27 Sep 2012 at 3:37

GoogleCodeExporter commented 8 years ago

Original comment by andres.traks on 29 Sep 2012 at 1:02