coreaudio: Flush/stop the AudioQueue before disposing of it.

Otherwise, a CoreAudio thread lingers forever, and coreaudiod eats CPU
until the SDL process terminates.

Fixes #7689.

(cherry picked from commit 86786ed5447fe32ea2e48f12f0598816a76721c2)
main
Ryan C. Gordon 2023-05-08 14:25:01 -04:00
parent 7f2ef4d02f
commit a88aeb2a8a
1 changed files with 2 additions and 0 deletions

View File

@ -690,6 +690,8 @@ static void COREAUDIO_CloseDevice(_THIS)
/* dispose of the audio queue before waiting on the thread, or it might stall for a long time! */
if (this->hidden->audioQueue) {
AudioQueueFlush(this->hidden->audioQueue);
AudioQueueStop(this->hidden->audioQueue, 0);
AudioQueueDispose(this->hidden->audioQueue, 0);
}