Commit 03e36da8 authored by David Reid's avatar David Reid

Try fixing a strange error when initializing a POSIX mutex.

https://github.com/mackron/miniaudio/issues/733
parent a47f065a
......@@ -16178,7 +16178,15 @@ static void ma_thread_wait__posix(ma_thread* pThread)
static ma_result ma_mutex_init__posix(ma_mutex* pMutex)
{
int result = pthread_mutex_init((pthread_mutex_t*)pMutex, NULL);
int result;
if (pMutex == NULL) {
return MA_INVALID_ARGS;
}
MA_ZERO_OBJECT(pMutex);
result = pthread_mutex_init((pthread_mutex_t*)pMutex, NULL);
if (result != 0) {
return ma_result_from_errno(result);
}
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