fix memory leak in BulletMultiThreaded

Fixes Issue 271.
This commit is contained in:
erwin.coumans
2012-09-09 20:53:55 +00:00
parent 7bb4e0e1bd
commit 491c91f486
3 changed files with 8 additions and 0 deletions

View File

@@ -248,6 +248,9 @@ void PosixThreadSupport::stopSPU()
destroySem(spuStatus.startSemaphore);
printf("semaphore destroyed\n");
checkPThreadFunction(pthread_join(spuStatus.thread,0));
if(spuStatus.m_lsMemory)
delete spuStatus.m_lsMemory;
}
printf("destroy main semaphore\n");
destroySem(mainSemaphore);

View File

@@ -299,6 +299,9 @@ void Win32ThreadSupport::stopSPU()
CloseHandle(spuStatus.m_eventCompletetHandle);
CloseHandle(spuStatus.m_eventStartHandle);
CloseHandle(spuStatus.m_threadHandle);
if(spuStatus.m_lsMemory)
delete spuStatus.m_lsMemory;
}
m_activeSpuStatus.clear();

View File

@@ -1157,6 +1157,8 @@ btParallelConstraintSolver::~btParallelConstraintSolver()
{
delete m_memoryCache;
delete m_solverIO;
delete m_barrier;
delete m_criticalSection;
}