From 67ed7d9d4929d8fe1c5f976c184c72dff02d83b7 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 25 Jul 2011 15:06:45 -0700 Subject: [PATCH] Fix UNIX-specific thread handle leak. --- src/util.h | 3 +++ 1 file changed, 3 insertions(+) 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; }