mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-24 15:53:45 +02:00
Fix race condition in Movie
destructor
This commit is contained in:
parent
8cf251bd5d
commit
09ec1db6f4
1 changed files with 6 additions and 5 deletions
|
@ -397,6 +397,12 @@ struct Movie
|
|||
~Movie()
|
||||
{
|
||||
if (hasAudio) {
|
||||
audioThreadTermReq.set();
|
||||
if(audioThread) {
|
||||
SDL_WaitThread(audioThread, 0);
|
||||
audioThread = 0;
|
||||
}
|
||||
|
||||
if (audioQueueTail) {
|
||||
THEORAPLAY_freeAudio(audioQueueTail->audio);
|
||||
}
|
||||
|
@ -407,11 +413,6 @@ 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);
|
||||
|
|
Loading…
Add table
Reference in a new issue