diff --git a/src/display/graphics.cpp b/src/display/graphics.cpp index a20bc19a..366fe980 100644 --- a/src/display/graphics.cpp +++ b/src/display/graphics.cpp @@ -402,14 +402,14 @@ struct Movie audioQueueHead = NULL; SDL_DestroyMutex(audioMutex); audioThreadTermReq.set(); + if(audioThread) { + SDL_WaitThread(audioThread, 0); + audioThread = 0; + } alSourceStop(audioSource); alDeleteSources(1, &audioSource); alDeleteBuffers(STREAM_BUFS, alBuffers); } - if(audioThread) { - SDL_WaitThread(audioThread, 0); - audioThread = 0; - } if (video) THEORAPLAY_freeVideo(video); if (audio) THEORAPLAY_freeAudio(audio); if (decoder) THEORAPLAY_stopDecode(decoder);