Don't crash if SDL_AudioQuit() is called twice in a row.
authorRyan C. Gordon
Fri, 05 Jul 2013 00:54:00 -0400
changeset 73450021ad840cdd
parent 7344 3d9397262c10
child 7346 ff228f955a48
Don't crash if SDL_AudioQuit() is called twice in a row.

Fixes Bugzilla #1396.
src/audio/SDL_audio.c
     1.1 --- a/src/audio/SDL_audio.c	Fri Jul 05 00:41:34 2013 -0400
     1.2 +++ b/src/audio/SDL_audio.c	Fri Jul 05 00:54:00 2013 -0400
     1.3 @@ -1172,6 +1172,10 @@
     1.4  void
     1.5  SDL_AudioQuit(void)
     1.6  {
     1.7 +    if (!current_audio.name) {  /* not initialized?! */
     1.8 +        return;
     1.9 +    }
    1.10 +
    1.11      SDL_AudioDeviceID i;
    1.12      for (i = 0; i < SDL_arraysize(open_devices); i++) {
    1.13          if (open_devices[i] != NULL) {