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 9396 69c501ed36f3
parent 9395 65e946d15533
child 9397 d72d2aa46341
Don't assert if an audio backend reports the same device disconnected twice.
src/audio/SDL_audio.c
--- a/src/audio/SDL_audio.c	Wed Mar 18 10:29:04 2015 -0400
+++ b/src/audio/SDL_audio.c	Thu Mar 19 13:15:28 2015 -0400
@@ -424,7 +424,10 @@
 void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
 {
     SDL_assert(get_audio_device(device->id) == device);
-    SDL_assert(device->enabled);  /* called more than once?! */
+
+    if (!device->enabled) {
+        return;
+    }
 
     /* Ends the audio callback and mark the device as STOPPED, but the
        app still needs to close the device to free resources. */