fix more memory leaks, ImportURDFExample is now leak-free

eliminate all run-time memory allocation (except for mouse-pick/ray-intersection) in ImportURDFExample
This commit is contained in:
Erwin Coumans
2016-07-16 17:40:44 -07:00
parent 2caa2b7ff4
commit e2bdd7dbb1
13 changed files with 146 additions and 70 deletions

View File

@@ -1058,7 +1058,7 @@ btCollisionShape* BulletURDFImporter::getAllocatedCollisionShape(int index)
{
const UrdfCollision& col = link->m_collisionArray[v];
btCollisionShape* childShape = convertURDFToCollisionShape(&col ,pathPrefix);
//m_data->m_allocatedCollisionShapes.push_back(childShape);
m_data->m_allocatedCollisionShapes.push_back(childShape);
if (childShape)
{

View File

@@ -352,6 +352,7 @@ void ImportUrdfSetup::initPhysics()
btVector3 groundHalfExtents(20,20,20);
groundHalfExtents[upAxis]=1.f;
btBoxShape* box = new btBoxShape(groundHalfExtents);
m_collisionShapes.push_back(box);
box->initializePolyhedralFeatures();
m_guiHelper->createCollisionShapeGraphicsObject(box);