cleanup memory in CcdPhysicsDemo, RagdollDemo, ConcaveDemo, BspDemo (work in progress)

This commit is contained in:
ejcoumans
2007-11-01 05:50:50 +00:00
parent a146bbc293
commit f3424f491c
11 changed files with 479 additions and 107 deletions

View File

@@ -87,6 +87,7 @@ btBvhTriangleMeshShape::~btBvhTriangleMeshShape()
{
if (m_ownsBvh)
{
m_bvh->~btOptimizedBvh();
btAlignedFree(m_bvh);
}
}
@@ -186,6 +187,7 @@ void btBvhTriangleMeshShape::setLocalScaling(const btVector3& scaling)
btTriangleMeshShape::setLocalScaling(scaling);
if (m_ownsBvh)
{
m_bvh->~btOptimizedBvh();
btAlignedFree(m_bvh);
}
///m_localAabbMin/m_localAabbMax is already re-calculated in btTriangleMeshShape. We could just scale aabb, but this needs some more work