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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user