Removed many memoryleaks in Example Browser, reducing some technical debt.
When running the Example Browser with Basic Example, 'visual leak detector' show no leak. Many other individual examples still leak, so it is work-in-progress. Disabled the profiler window (too many leaks)
This commit is contained in:
@@ -73,6 +73,7 @@ class InverseDynamicsExample : public CommonMultiBodyBase
|
||||
{
|
||||
btInverseDynamicsExampleOptions m_option;
|
||||
btMultiBody* m_multiBody;
|
||||
btAlignedObjectArray<btCollisionShape*> m_allocatedShapes;
|
||||
btInverseDynamics::MultiBodyTree *m_inverseModel;
|
||||
TimeSeriesCanvas* m_timeSeriesCanvas;
|
||||
public:
|
||||
@@ -105,7 +106,13 @@ InverseDynamicsExample::InverseDynamicsExample(struct GUIHelperInterface* helper
|
||||
|
||||
InverseDynamicsExample::~InverseDynamicsExample()
|
||||
{
|
||||
|
||||
delete m_multiBody;
|
||||
for (int i = 0; i < m_allocatedShapes.size(); i++)
|
||||
{
|
||||
delete m_allocatedShapes[i];
|
||||
}
|
||||
m_allocatedShapes.resize(0);
|
||||
delete m_inverseModel;
|
||||
delete m_timeSeriesCanvas;
|
||||
}
|
||||
@@ -166,6 +173,10 @@ void InverseDynamicsExample::initPhysics()
|
||||
btTransform identityTrans;
|
||||
identityTrans.setIdentity();
|
||||
ConvertURDF2Bullet(u2b,creation, identityTrans,m_dynamicsWorld,true,u2b.getPathPrefix());
|
||||
for (int i = 0; i < u2b.getNumAllocatedCollisionShapes(); i++)
|
||||
{
|
||||
m_allocatedShapes.push_back(u2b.getAllocatedCollisionShape(i));
|
||||
}
|
||||
m_multiBody = creation.getBulletMultiBody();
|
||||
if (m_multiBody)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user