#2 thread handle leak resource

open
nobody
None
5
2005-01-19
2005-01-19
s1gfr1d0
No

In Restart Thread win32.cxx
void PThread::Restart()
{
PAssert(IsTerminated(), "Cannot restart running thread");
here close old handle.....
#ifndef _WIN32_WCE
threadHandle = (HANDLE)_beginthreadex(NULL,
originalStackSize,
MainFunction, this, 0, &threadId);
#else
threadHandle = CreateThread(NULL, originalStackSize,
(LPTHREAD_START_ROUTINE) MainFunction,
this, 0, (LPDWORD) &threadId);
#endif
PAssertOS(threadHandle != NULL);
}

I think that you should call CloseHandle to free system
resource of previous started thread.

Discussion