From b158bfe37e48a52c01f6f7428209b072612ffd0e Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 17 Feb 2022 22:41:34 +0000 Subject: [PATCH] Always stop the sounds, because we're always calling Z_FreeTags and that can lead to invalid memory. (Should fix Rai's crash) --- src/p_setup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 6e77d0435..f5a03e628 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -4029,13 +4029,14 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) } */ + // Make sure all sounds are stopped before Z_FreeTags. + S_StopSounds(); + S_ClearSfx(); + // Let's fade to white here // But only if we didn't do the encore startup wipe if (!demo.rewinding && !reloadinggamestate) { - // Make sure all sounds are stopped before Z_FreeTags. - S_StopSounds(); - S_ClearSfx(); // Fade out music here. Deduct 2 tics so the fade volume actually reaches 0. // But don't halt the music! S_Start will take care of that. This dodges a MIDI crash bug.