Merge branch 'master' of https://github.com/bitcoin/bitcoin
[novacoin.git] / src / util.h
index 7ac36c0..a1e3c26 100644 (file)
@@ -621,7 +621,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;
 }