Fix UNIX-specific thread handle leak.
authorJoelKatz <DavidJoelSchwartz@GMail.com>
Mon, 25 Jul 2011 22:06:45 +0000 (15:06 -0700)
committerJoelKatz <DavidJoelSchwartz@GMail.com>
Mon, 25 Jul 2011 22:06:45 +0000 (15:06 -0700)
src/util.h

index 9922ba8..8588201 100644 (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;
 }