dGeomTransformSetCleanup performs an automatic cleanup of the geoms when the transform is deleted. It doesn't remove the collision data though leading to potential memory leaks. The reason it's causing the MAV would be due to deleting the geoms manually, then ODE tries to do it too and they're not there anymore. Danny highlighted a problem with this function in JV-ODE Physics Thread 8, about a third of the way down. Have a look at it if you can.
The solution to cleanup transform geoms and their data correctly is as follows...
First you -must- set the transform cleanup mode to zero (disable) for this to work correctly...
I'd recommend switching over to Geom Offsets instead of Geom Transforms, as they're much easier to manage.
If you want to delete entire objects, it's best to delete them individually in the reverse order that they were created...
Joint(s) > Geom(s) > Body > Type
The solution to cleanup transform geoms and their data correctly is as follows...
First you -must- set the transform cleanup mode to zero (disable) for this to work correctly...
dGeomTransformSetCleanup TransformGeom,0Next, when you want to destroy the transform and parent geoms, you should do it in the following order...
dGeomDestroy GeomObject dGeomDestroy TransformGeom dGeomDestroy Geom dBodyDestroy BodyNow everything is cleaned up correctly and there's no memory leak.
I'd recommend switching over to Geom Offsets instead of Geom Transforms, as they're much easier to manage.
If you want to delete entire objects, it's best to delete them individually in the reverse order that they were created...
Joint(s) > Geom(s) > Body > Type