Page 1 of 1

does btTriangleMesh need to be deleted?

Posted: Fri Mar 06, 2015 5:36 pm
by ed_welch
Hi All,
Quicky question.
I am creating a btTriangleMesh and then creating a btBvhTriangleMeshShape using that object.
Do I need to specifically delete the btTriangleMesh object?
I ask because in the RayTest demo they create btTriangleMesh object, but don't delete it.

Re: does btTriangleMesh need to be deleted?

Posted: Sun Mar 08, 2015 7:24 pm
by Erwin Coumans
For btBvhTriangleMeshShape you need to keep the mesh data around (there is no deep copy of data), until you delete the btBvhTriangleMeshShape, and only then you can delete/free the btTriangleMesh. Some demos might leak memory, that needs to be fixed.

Re: does btTriangleMesh need to be deleted?

Posted: Mon Mar 09, 2015 11:14 am
by ed_welch
Erwin Coumans wrote:For btBvhTriangleMeshShape you need to keep the mesh data around (there is no deep copy of data), until you delete the btBvhTriangleMeshShape, and only then you can delete/free the btTriangleMesh. Some demos might leak memory, that needs to be fixed.
Ok, thanks for the answer ;)