mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-25 08:13:44 +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()
|
~Movie()
|
||||||
{
|
{
|
||||||
if (hasAudio) {
|
if (hasAudio) {
|
||||||
|
audioThreadTermReq.set();
|
||||||
|
if(audioThread) {
|
||||||
|
SDL_WaitThread(audioThread, 0);
|
||||||
|
audioThread = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (audioQueueTail) {
|
if (audioQueueTail) {
|
||||||
THEORAPLAY_freeAudio(audioQueueTail->audio);
|
THEORAPLAY_freeAudio(audioQueueTail->audio);
|
||||||
}
|
}
|
||||||
|
@ -407,11 +413,6 @@ struct Movie
|
||||||
}
|
}
|
||||||
audioQueueHead = NULL;
|
audioQueueHead = NULL;
|
||||||
SDL_DestroyMutex(audioMutex);
|
SDL_DestroyMutex(audioMutex);
|
||||||
audioThreadTermReq.set();
|
|
||||||
if(audioThread) {
|
|
||||||
SDL_WaitThread(audioThread, 0);
|
|
||||||
audioThread = 0;
|
|
||||||
}
|
|
||||||
alSourceStop(audioSource);
|
alSourceStop(audioSource);
|
||||||
alDeleteSources(1, &audioSource);
|
alDeleteSources(1, &audioSource);
|
||||||
alDeleteBuffers(STREAM_BUFS, alBuffers);
|
alDeleteBuffers(STREAM_BUFS, alBuffers);
|
||||||
|
|
Loading…
Add table
Reference in a new issue