diff options
author | JoelKatz <DavidJoelSchwartz@GMail.com> | 2011-07-25 15:06:45 -0700 |
---|---|---|
committer | JoelKatz <DavidJoelSchwartz@GMail.com> | 2011-07-25 15:06:45 -0700 |
commit | 67ed7d9d4929d8fe1c5f976c184c72dff02d83b7 (patch) | |
tree | 41c5d99983e179c05a9a71beceb7e2865869c746 | |
parent | 36cd1ad5c90957608f711f79c7c2d8ef8a05c252 (diff) |
Fix UNIX-specific thread handle leak.
-rw-r--r-- | src/util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 9922ba82a9..8588201dae 100644 --- a/src/util.h +++ b/src/util.h @@ -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; } |