Prevent the game from still attempting to save replays during a game exit

Resolves SIGSEGV no. 8
This commit is contained in:
yamamama 2025-11-20 03:06:11 -05:00
parent 0534eb4121
commit bf8fe049c2
3 changed files with 8 additions and 1 deletions

View file

@ -4364,7 +4364,7 @@ boolean G_CheckDemoStatus(void)
return true;
}
if (demo.recording && (modeattacking || demo.savemode != DSM_NOTSAVING))
if (demo.recording && (modeattacking || demo.savemode != DSM_NOTSAVING) && (!demo.gamequit))
{
G_SaveDemo();
return true;

View file

@ -59,6 +59,7 @@ struct demovars_s {
} savemode;
boolean freecam;
boolean gamequit; // Game is exiting.
const savebuffer_t *buffer; // debug, valid only if recording or playback
};

View file

@ -1936,7 +1936,13 @@ void I_Quit(void)
// but sometimes we forget and use 'F10'.. so save here too.
if (demo.recording)
{
// SIGSEGV #8 is caused by the game still trying to save to an empty pointer.
// Prevent that by doing... this!
demo.gamequit = true;
G_CheckDemoStatus();
}
if (metalrecording)
G_StopMetalRecording(false);