From e85d07d0500efaa109fe6f25d70cf1708459af39 Mon Sep 17 00:00:00 2001 From: Sahnvour Date: Fri, 21 Jan 2022 01:12:43 +0100 Subject: [PATCH] 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. --- miniaudio.h | 1 - 1 file changed, 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index 9ee388ca..bce937b0 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -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) { pthread_join((pthread_t)*pThread, NULL); - pthread_detach((pthread_t)*pThread); }