mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-07 18:42:55 +02:00
Movie audio disposal bugfix
Put the audioThread check within the hasAudio conditional in the movie destructor The order is significant, as trying to dispose of OpenAL objects before audioThread is complete can result in hanging
This commit is contained in:
parent
92167bdfc9
commit
2894880550
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue