make the btAcosf/btAsinf fix multi-line to make it easier to put breakpoints.

fix a memory leak issue with ColladaConverter (keep track of the btTriangleMesh containers)
This commit is contained in:
erwin.coumans
2009-10-09 23:53:18 +00:00
parent 703582f4fa
commit f3525c3a86
3 changed files with 16 additions and 3 deletions

View File

@@ -2894,6 +2894,7 @@ btCollisionShape* ColladaConverter::createCylinderShapeY(btScalar radius,btScala
btTriangleMesh* ColladaConverter::createTriangleMeshContainer()
{
btTriangleMesh* meshContainer = new btTriangleMesh(m_use32bitIndices,m_use4componentVertices);
m_allocatedTriangleMeshContainers.push_back(meshContainer);
return meshContainer;
}
@@ -2948,6 +2949,12 @@ void ColladaConverter::deleteAllocatedCollisionShapes()
delete m_allocatedCollisionShapes[i];
}
m_allocatedCollisionShapes.clear();
for (int i=0;i<m_allocatedTriangleMeshContainers.size();i++)
{
delete m_allocatedTriangleMeshContainers[i];
}
m_allocatedTriangleMeshContainers.clear();
}
void ColladaConverter::deleteShape(btCollisionShape* shape)

View File

@@ -86,7 +86,7 @@ protected:
btDynamicsWorld* m_dynamicsWorld;
btAlignedObjectArray<class btCollisionShape*> m_allocatedCollisionShapes;
btAlignedObjectArray<class btTriangleMesh*> m_allocatedTriangleMeshContainers;
btHashMap<btHashKeyPtr<btRigidBodyColladaInfo*>,btRigidBodyColladaInfo*> m_rbUserInfoHashMap;
btHashMap<btHashKeyPtr<btRigidConstraintColladaInfo*>,btRigidConstraintColladaInfo*> m_constraintUserInfoHashMap;