Don't assert if an audio backend reports the same device disconnected twice.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 19 Mar 2015 13:15:28 -0400
changeset 939669c501ed36f3
parent 9395 65e946d15533
child 9397 d72d2aa46341
Don't assert if an audio backend reports the same device disconnected twice.
src/audio/SDL_audio.c
     1.1 --- a/src/audio/SDL_audio.c	Wed Mar 18 10:29:04 2015 -0400
     1.2 +++ b/src/audio/SDL_audio.c	Thu Mar 19 13:15:28 2015 -0400
     1.3 @@ -424,7 +424,10 @@
     1.4  void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
     1.5  {
     1.6      SDL_assert(get_audio_device(device->id) == device);
     1.7 -    SDL_assert(device->enabled);  /* called more than once?! */
     1.8 +
     1.9 +    if (!device->enabled) {
    1.10 +        return;
    1.11 +    }
    1.12  
    1.13      /* Ends the audio callback and mark the device as STOPPED, but the
    1.14         app still needs to close the device to free resources. */