mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +00:00
fixing couple of small memory leaks
This commit is contained in:
parent
50b0e97332
commit
9f71d55258
3 changed files with 24 additions and 0 deletions
|
@ -585,3 +585,24 @@ Cvar_Init(void)
|
|||
Cmd_AddCommand("cvarlist", Cvar_List_f);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free list of cvars
|
||||
*/
|
||||
void
|
||||
Cvar_Fini(void)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
for (var = cvar_vars; var;)
|
||||
{
|
||||
cvar_t *c = var;
|
||||
Z_Free(var->string);
|
||||
Z_Free(var->name);
|
||||
Z_Free(var);
|
||||
var = c->next;
|
||||
}
|
||||
|
||||
Cmd_RemoveCommand("cvarlist");
|
||||
Cmd_RemoveCommand("set");
|
||||
}
|
||||
|
||||
|
|
|
@ -475,6 +475,8 @@ void Cvar_WriteVariables(char *path);
|
|||
|
||||
void Cvar_Init(void);
|
||||
|
||||
void Cvar_Fini(void);
|
||||
|
||||
char *Cvar_Userinfo(void);
|
||||
|
||||
/* returns an info string containing all the CVAR_USERINFO cvars */
|
||||
|
|
|
@ -411,5 +411,6 @@ Qcommon_Frame(int msec)
|
|||
void
|
||||
Qcommon_Shutdown(void)
|
||||
{
|
||||
Cvar_Fini();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue