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 73424828e86c6010
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
     1.1 --- a/src/audio/SDL_audio.c	Wed Jul 03 12:31:40 2013 -0700
     1.2 +++ b/src/audio/SDL_audio.c	Fri Jul 05 00:30:23 2013 -0400
     1.3 @@ -1174,7 +1174,9 @@
     1.4  {
     1.5      SDL_AudioDeviceID i;
     1.6      for (i = 0; i < SDL_arraysize(open_devices); i++) {
     1.7 -        SDL_CloseAudioDevice(i);
     1.8 +        if (open_devices[i] != NULL) {
     1.9 +            SDL_CloseAudioDevice(i);
    1.10 +        }
    1.11      }
    1.12  
    1.13      /* Free the driver data */