does btTriangleMesh need to be deleted?

Post Reply
ed_welch
Posts: 43
Joined: Wed Mar 04, 2015 6:16 pm

does btTriangleMesh need to be deleted?

Post 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.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: does btTriangleMesh need to be deleted?

Post 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.
ed_welch
Posts: 43
Joined: Wed Mar 04, 2015 6:16 pm

Re: does btTriangleMesh need to be deleted?

Post 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 ;)
Post Reply