fix undefined behavior in ma_thread_wait__posix

Quoting man for pthread_detach:
> The behavior is undefined if the value specified by the thread argument
> to pthread_detach() does not refer to a joinable thread.

Since the thread was joined right before, pthread_detach should not be called.
This commit is contained in:
Sahnvour
2022-01-21 01:12:43 +01:00
parent 4f43538cd6
commit e85d07d050
-1
View File
@@ -15534,7 +15534,6 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
static void ma_thread_wait__posix(ma_thread* pThread) static void ma_thread_wait__posix(ma_thread* pThread)
{ {
pthread_join((pthread_t)*pThread, NULL); pthread_join((pthread_t)*pThread, NULL);
pthread_detach((pthread_t)*pThread);
} }