[ODE] Memory Leak

Bram Stolk bram at sara.nl
Wed Dec 28 04:12:19 MST 2005


Jaroslav Sinecky wrote:
> Well this is really surprising to me because I was conviced there are no
> dynamic memory allocations inside ode colliders or solver. But in
> collision_trimesh_ccylinder.cpp there is one! And effectively, the
> deallocation is skipped in early exit test on line 1018:
> 
> 	 if (! Collider.GetContactStatus()) {
> 	 	// no collision occurred
> 	 	return 0;
> 	 }
> 
> So this is the leak. I would suggest to use ode-style stack allocation or
> static buffer like in cylinder_trimesh for example. But by the way, looking

Until the dynamic alloc is replaced, I've fixed this in cvs by
adding a delete[] to the early return.

This fix is in the UNSTABLE branch only.

   Bram


More information about the ODE mailing list