fix thread leak, gota detach

This commit is contained in:
jsorg71
2005-02-17 01:38:32 +00:00
parent aafcaa6a56
commit 97b2519fd4
3 changed files with 11 additions and 3 deletions
+4 -1
View File
@@ -590,8 +590,11 @@ int g_thread_create(unsigned long (__stdcall * start_routine)(void*), void* arg)
int g_thread_create(void* (* start_routine)(void*), void* arg)
{
pthread_t thread;
int rv;
return pthread_create(&thread, 0, start_routine, arg);
rv = pthread_create(&thread, 0, start_routine, arg);
pthread_detach(thread);
return rv;
}
#endif