Don't close already-closed audio devices during SDL_Quit().
authorRyan C. Gordon <icculus@icculus.org>
Fri, 05 Jul 2013 00:30:23 -0400
changeset 7342 4828e86c6010
parent 7341 675c85d46f30
child 7343 faf0d8c7dbec
Don't close already-closed audio devices during SDL_Quit(). Otherwise, we spam a bunch of unnecessary SDL_SetError() calls. Fixes Bugzilla #1791.
src/audio/SDL_audio.c
--- a/src/audio/SDL_audio.c	Wed Jul 03 12:31:40 2013 -0700
+++ b/src/audio/SDL_audio.c	Fri Jul 05 00:30:23 2013 -0400
@@ -1174,7 +1174,9 @@
 {
     SDL_AudioDeviceID i;
     for (i = 0; i < SDL_arraysize(open_devices); i++) {
-        SDL_CloseAudioDevice(i);
+        if (open_devices[i] != NULL) {
+            SDL_CloseAudioDevice(i);
+        }
     }
 
     /* Free the driver data */