瀏覽代碼

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.
Ryan C. Gordon 2 年之前
父節點
當前提交
86786ed544
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/audio/coreaudio/SDL_coreaudio.m

+ 2 - 0
src/audio/coreaudio/SDL_coreaudio.m

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