mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-03 20:45:41 +00:00
coreaudio: Possibly fixed another shutdown race condition.
Reference Issue #6159.
This commit is contained in:
parent
7567c4cb00
commit
e6640ef2d4
|
@ -701,6 +701,14 @@ COREAUDIO_CloseDevice(_THIS)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* if callback fires again, feed silence; don't call into the app. */
|
||||||
|
SDL_AtomicSet(&this->paused, 1);
|
||||||
|
|
||||||
|
if (this->hidden->thread) {
|
||||||
|
SDL_assert(SDL_AtomicGet(&this->shutdown) != 0); /* should have been set by SDL_audio.c */
|
||||||
|
SDL_WaitThread(this->hidden->thread, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (iscapture) {
|
if (iscapture) {
|
||||||
open_capture_devices--;
|
open_capture_devices--;
|
||||||
} else {
|
} else {
|
||||||
|
@ -725,18 +733,10 @@ COREAUDIO_CloseDevice(_THIS)
|
||||||
open_devices = NULL;
|
open_devices = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if callback fires again, feed silence; don't call into the app. */
|
|
||||||
SDL_AtomicSet(&this->paused, 1);
|
|
||||||
|
|
||||||
if (this->hidden->audioQueue) {
|
if (this->hidden->audioQueue) {
|
||||||
AudioQueueDispose(this->hidden->audioQueue, 1);
|
AudioQueueDispose(this->hidden->audioQueue, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->hidden->thread) {
|
|
||||||
SDL_assert(SDL_AtomicGet(&this->shutdown) != 0); /* should have been set by SDL_audio.c */
|
|
||||||
SDL_WaitThread(this->hidden->thread, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->hidden->ready_semaphore) {
|
if (this->hidden->ready_semaphore) {
|
||||||
SDL_DestroySemaphore(this->hidden->ready_semaphore);
|
SDL_DestroySemaphore(this->hidden->ready_semaphore);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue