mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix some G_BuildMapTitle memory leaks (found while writing the next commit)
This commit is contained in:
parent
5a404799b3
commit
6d3a812ff3
3 changed files with 13 additions and 3 deletions
|
|
@ -540,7 +540,9 @@ void DRPC_UpdatePresence(void)
|
|||
else
|
||||
{
|
||||
// Map name on tool tip
|
||||
snprintf(mapname, 48, "Map: %s", G_BuildMapTitle(gamemap));
|
||||
char *title = G_BuildMapTitle(gamemap);
|
||||
snprintf(mapname, 48, "Map: %s", title);
|
||||
Z_Free(title);
|
||||
discordPresence.largeImageText = mapname;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2358,7 +2358,11 @@ void G_BeginRecording(void)
|
|||
|
||||
// Full replay title
|
||||
demo_p += 64;
|
||||
snprintf(demo.titlename, 64, "%s - %s", G_BuildMapTitle(gamemap), modeattacking ? "Record Attack" : connectedservername);
|
||||
{
|
||||
char *title = G_BuildMapTitle(gamemap);
|
||||
snprintf(demo.titlename, 64, "%s - %s", title, modeattacking ? "Record Attack" : connectedservername);
|
||||
Z_Free(title);
|
||||
}
|
||||
|
||||
// demo checksum
|
||||
demo_p += 16;
|
||||
|
|
|
|||
|
|
@ -3970,7 +3970,11 @@ static void M_DrawReplayHutReplayInfo(menudemo_t *demoref)
|
|||
x += 85;
|
||||
|
||||
if (demoref->map < nummapheaders && mapheaderinfo[demoref->map])
|
||||
V_DrawString(x, y, V_SNAPTOTOP, G_BuildMapTitle(demoref->map+1));
|
||||
{
|
||||
char *title = G_BuildMapTitle(demoref->map+1);
|
||||
V_DrawString(x, y, V_SNAPTOTOP, title);
|
||||
Z_Free(title);
|
||||
}
|
||||
else
|
||||
V_DrawString(x, y, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT, "Level is not loaded.");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue