remove some memory leaks in example code.

This commit is contained in:
Erwin Coumans
2017-01-10 14:57:16 -08:00
parent 5e948ebe00
commit 3d6584962a
18 changed files with 103 additions and 38 deletions

View File

@@ -573,7 +573,7 @@ public:
virtual ~MultiThreadedOpenGLGuiHelper()
{
delete m_childGuiHelper;
//delete m_childGuiHelper;
}
void setCriticalSection(b3CriticalSection* cs)
@@ -1152,9 +1152,12 @@ PhysicsServerExample::~PhysicsServerExample()
#ifdef BT_ENABLE_VR
delete m_tinyVrGui;
#endif
bool deInitializeSharedMemory = true;
m_physicsServer.disconnectSharedMemory(deInitializeSharedMemory);
m_isConnected = false;
delete m_multiThreadedHelper;
}
bool PhysicsServerExample::isConnected()
@@ -1247,6 +1250,11 @@ void PhysicsServerExample::exitPhysics()
printf("stopping threads\n");
m_threadSupport->deleteCriticalSection(m_args[0].m_cs);
m_threadSupport->deleteCriticalSection(m_args[0].m_cs2);
m_threadSupport->deleteCriticalSection(m_args[0].m_cs3);
m_threadSupport->deleteCriticalSection(m_args[0].m_csGUI);
delete m_threadSupport;
m_threadSupport = 0;