From 68076ec85594db47fb8db272e13755d0b59c6acc Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 1 Mar 2025 15:18:10 -0800 Subject: [PATCH] Bug Fix: Wait for output to shut down first In case stop function called on another thread, wait for it to complete first. Signed-off-by: Christopher Snowhill --- Audio/Output/OutputCoreAudio.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Audio/Output/OutputCoreAudio.m b/Audio/Output/OutputCoreAudio.m index c2b3f915e..d74a00069 100644 --- a/Audio/Output/OutputCoreAudio.m +++ b/Audio/Output/OutputCoreAudio.m @@ -825,6 +825,10 @@ current_device_listener(AudioObjectID inObjectID, UInt32 inNumberAddresses, cons - (void)dealloc { [self stop]; + // In case stop called on another thread first + while(!stopCompleted) { + usleep(500); + } } - (void)pause {