From 206a3e42e741306f4f15d91ab6553b63805155c4 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 26 Jun 2022 14:47:34 -0700 Subject: [PATCH] [Equalizer] Prevent crash on stop Wait for the equalizer to be shut down properly by the main thread before destroying it. Otherwise, the main thread could crash on stop, due to accessing the equalizer handle while it's being torn down in the output thread. Signed-off-by: Christopher Snowhill --- Audio/AudioPlayer.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Audio/AudioPlayer.m b/Audio/AudioPlayer.m index aa0cbc54f..7b57b346b 100644 --- a/Audio/AudioPlayer.m +++ b/Audio/AudioPlayer.m @@ -284,7 +284,7 @@ } - (void)endEqualizer:(AudioUnit)eq { - [self sendDelegateMethod:@selector(audioPlayer:removeEqualizer:) withVoid:eq waitUntilDone:NO]; + [self sendDelegateMethod:@selector(audioPlayer:removeEqualizer:) withVoid:eq waitUntilDone:YES]; } - (void)addChainToQueue:(BufferChain *)newChain {