From e358e72f674c4ade164aa21be74d2989fd454c93 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 31 Jul 2021 09:16:52 +1000 Subject: [PATCH] Core Audio: Fix a possible deadlock when uninitializing a device. --- miniaudio.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miniaudio.h b/miniaudio.h index 3da43684..89173231 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -26556,6 +26556,8 @@ static ma_result ma_context__uninit_device_tracking__coreaudio(ma_context* pCont /* At this point there should be no tracked devices. If not there's an error somewhere. */ if (g_ppTrackedDevices_CoreAudio != NULL) { ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_WARNING, "You have uninitialized all contexts while an associated device is still active.", MA_INVALID_OPERATION); + ma_spinlock_unlock(&g_DeviceTrackingInitLock_CoreAudio); + return MA_INVALID_OPERATION; } ma_mutex_uninit(&g_DeviceTrackingMutex_CoreAudio);