mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 21:20:54 +00:00
Fix crash if you start recording a replay and immediately close the game
This commit is contained in:
parent
a8e16638ee
commit
76702d6712
1 changed files with 6 additions and 3 deletions
|
@ -2382,9 +2382,12 @@ static void WriteDemoChecksum(void)
|
|||
static void G_StopDemoRecording(void)
|
||||
{
|
||||
boolean saved = false;
|
||||
WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker
|
||||
WriteDemoChecksum();
|
||||
saved = FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer); // finally output the file.
|
||||
if (demo_p)
|
||||
{
|
||||
WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker
|
||||
WriteDemoChecksum();
|
||||
saved = FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer); // finally output the file.
|
||||
}
|
||||
free(demobuffer);
|
||||
demorecording = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue