Probable bug in TriangleMeshCollisionShape

dangerdaveCS

01-03-2010 13:06:11

This is the second time I've been tripped up by a memory leak coming from OgreBullet. Am I not using OgreBullet correctly? Does it have some kind of cleanup function I'm not calling, hence the memory leaks? Anyway...

The constructor of TriangleMeshCollisionShape creates a btTriangleMesh and then uses that to construct a btBvhTriangleMeshShape. The btBvhTriangleMeshShape is freed on destruction, but the original btTriangleMesh is not, hence a memory leak.

Fish

02-03-2010 00:11:10

You probably already know this, but for others who have encountered this problem you need to modify TriangleMeshCollisionShape::~TriangleMeshCollisionShape() to read:

{
if(mTriMesh)
{
delete mTriMesh;
}
mTriMesh = 0;
}


I've been meaning to submit a patch for this but I was waiting for Ogre 1.7 to be released since there is a 1.7 compatibility patch that also needs to be applied.

-Fish

Fish

02-03-2010 02:37:20

Patch submitted, see:

viewtopic.php?f=12&t=12188

-Fish