From bfa8e2510013188cc340731d260a22b278af7b43 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 9 Oct 2019 15:05:20 +0300 Subject: [PATCH] - fixed crash on exiting from IWAD selector https://forum.zdoom.org/viewtopic.php?t=66073 --- src/sound/s_sound.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sound/s_sound.cpp b/src/sound/s_sound.cpp index 58e9d30e89..08417277f3 100644 --- a/src/sound/s_sound.cpp +++ b/src/sound/s_sound.cpp @@ -352,7 +352,9 @@ void S_Shutdown () mus_playing.LastSong = ""; // If this isn't reset here, the song would attempt resume at the most inpopportune time... S_StopAllChannels(); - GSnd->UpdateSounds(); + if (GSnd) + GSnd->UpdateSounds(); + for (chan = FreeChannels; chan != NULL; chan = next) { next = chan->NextChan; @@ -1752,7 +1754,9 @@ void S_StopAllChannels () S_StopChannel(chan); chan = next; } - GSnd->UpdateSounds(); + + if (GSnd) + GSnd->UpdateSounds(); } //==========================================================================