aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorJoelKatz <DavidJoelSchwartz@GMail.com>2011-07-25 15:06:45 -0700
committerJoelKatz <DavidJoelSchwartz@GMail.com>2011-07-25 15:06:45 -0700
commit67ed7d9d4929d8fe1c5f976c184c72dff02d83b7 (patch)
tree41c5d99983e179c05a9a71beceb7e2865869c746 /src/util.h
parent36cd1ad5c90957608f711f79c7c2d8ef8a05c252 (diff)
Fix UNIX-specific thread handle leak.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h3
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;
}