Commit e85d07d0 authored by Sahnvour's avatar Sahnvour

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.
parent 4f43538c
...@@ -15534,7 +15534,6 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority ...@@ -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);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment