audio: Let apps save an audio stream from destruction during SDL_Quit(). (#13244)
This is a special-case piece of functionality, generally these are expected to go away during shutdown, but maybe someone is switching between audio subsystems or something...
This commit is contained in:
@@ -1073,9 +1073,16 @@ void SDL_QuitAudio(void)
|
||||
|
||||
current_audio.impl.DeinitializeStart();
|
||||
|
||||
// Destroy any audio streams that still exist...
|
||||
while (current_audio.existing_streams) {
|
||||
SDL_DestroyAudioStream(current_audio.existing_streams);
|
||||
// Destroy any audio streams that still exist...unless app asked to keep it.
|
||||
SDL_AudioStream *next = NULL;
|
||||
for (SDL_AudioStream *i = current_audio.existing_streams; i; i = next) {
|
||||
next = i->next;
|
||||
if (i->simplified || !SDL_GetBooleanProperty(i->props, SDL_PROP_AUDIOSTREAM_KEEP_ON_SHUTDOWN_BOOLEAN, false)) {
|
||||
SDL_DestroyAudioStream(i);
|
||||
} else {
|
||||
i->prev = NULL;
|
||||
i->next = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
SDL_LockRWLockForWriting(current_audio.device_hash_lock);
|
||||
|
||||
Reference in New Issue
Block a user