From a5d3be2569ed18cdb429a3b5207890dcd3e392e6 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 c8858916a..cc0baa6c9 100644 --- a/src/sound/s_sound.cpp +++ b/src/sound/s_sound.cpp @@ -353,7 +353,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; @@ -1747,7 +1749,9 @@ void S_StopAllChannels () S_StopChannel(chan); chan = next; } - GSnd->UpdateSounds(); + + if (GSnd) + GSnd->UpdateSounds(); } //==========================================================================