aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;
}