From 26302f411855ba77bcf96eae5f128796c51bf656 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 5 Jul 2013 00:54:00 -0400 Subject: [PATCH] Don't crash if SDL_AudioQuit() is called twice in a row. Fixes Bugzilla #1396. --- src/audio/SDL_audio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 059b75d29..5e30ad094 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1172,6 +1172,10 @@ SDL_CloseAudio(void) void SDL_AudioQuit(void) { + if (!current_audio.name) { /* not initialized?! */ + return; + } + SDL_AudioDeviceID i; for (i = 0; i < SDL_arraysize(open_devices); i++) { if (open_devices[i] != NULL) {