Memory leak in btPolyhedralConvexShape.cpp

MalcolmB
Posts: 8
Joined: Tue May 03, 2011 9:04 pm

Memory leak in btPolyhedralConvexShape.cpp

Post by MalcolmB »

Hey, the m_polyhedron object is freed using btAlignedFree(), but this doesn't call the object's destructor, so the aligned-vectors contained in the m_polyhedron aren't cleaned up.
The fix seems to be to add a call to

Code: Select all

m_polyhedron->~btConvexPolyhedron();
before freeing it's memory.
But I'm not sure if there is a different convention used for memory cleanup in the bullet code...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Memory leak in btPolyhedralConvexShape.cpp

Post by Erwin Coumans »

It might be a bug indeed, I'll check it out.

I was out of town for the last 2 weeks, so I have to catch up with things first.
Thanks for the report!
Erwin