More example code is memory-leak free now, in particular PhysicsServerExample.
/PhysicsServerCommandProcessor also fixed some memory issue in InverseDynamicsExample (the base class is supposed to delete collision shape memory)
This commit is contained in:
@@ -31,6 +31,10 @@ struct UrdfLinkNameMapUtil
|
||||
UrdfLinkNameMapUtil():m_mb(0),m_memSerializer(0)
|
||||
{
|
||||
}
|
||||
virtual ~UrdfLinkNameMapUtil()
|
||||
{
|
||||
delete m_memSerializer;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ PhysicsServerSharedMemory::PhysicsServerSharedMemory(SharedMemoryInterface* shar
|
||||
}
|
||||
|
||||
m_data->m_commandProcessor = new PhysicsServerCommandProcessor;
|
||||
m_data->m_commandProcessor ->createEmptyDynamicsWorld();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -701,7 +701,16 @@ void TinyRendererVisualShapeConverter::copyCameraImageData(unsigned char* pixels
|
||||
|
||||
void TinyRendererVisualShapeConverter::resetAll()
|
||||
{
|
||||
//todo: free memory
|
||||
for (int i=0;i<m_data->m_swRenderInstances.size();i++)
|
||||
{
|
||||
TinyRendererObjectArray** ptrptr = m_data->m_swRenderInstances.getAtIndex(i);
|
||||
if (ptrptr && *ptrptr)
|
||||
{
|
||||
TinyRendererObjectArray* ptr = *ptrptr;
|
||||
delete ptr;
|
||||
}
|
||||
}
|
||||
|
||||
m_data->m_swRenderInstances.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user