mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
On second thoughts, let's be EXTRA careful to avoid any potential double frees.
This commit is contained in:
parent
bf8d09980d
commit
859b3fa350
1 changed files with 8 additions and 2 deletions
10
src/g_demo.c
10
src/g_demo.c
|
|
@ -3061,7 +3061,7 @@ void G_DoPlayDemo(const char *defdemoname)
|
|||
else
|
||||
{
|
||||
// FIXME: this file doesn't manage its memory and actually free this when it's done using it
|
||||
Z_Free(demobuf.buffer);
|
||||
//Z_Free(demobuf.buffer);
|
||||
demobuf.buffer = NULL;
|
||||
|
||||
n = defdemoname+strlen(defdemoname);
|
||||
|
|
@ -4183,13 +4183,19 @@ boolean G_CheckDemoStatus(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (demo.recording && (modeattacking || demo.savemode != DSM_NOTSAVING))
|
||||
if (!demo.recording)
|
||||
return false;
|
||||
|
||||
if (modeattacking || demo.savemode != DSM_NOTSAVING)
|
||||
{
|
||||
G_SaveDemo();
|
||||
return true;
|
||||
}
|
||||
|
||||
Z_Free(demobuf.buffer);
|
||||
|
||||
demo.recording = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue