Fix UNIX-specific thread handle leak.

This commit is contained in:
JoelKatz 2011-07-25 15:06:45 -07:00
parent 36cd1ad5c9
commit 67ed7d9d49

View file

@ -623,7 +623,10 @@ inline pthread_t CreateThread(void(*pfn)(void*), void* parg, bool fWantHandle=fa
return (pthread_t)0;
}
if (!fWantHandle)
{
pthread_detach(hthread);
return (pthread_t)-1;
}
return hthread;
}