Skip to content

Commit

Permalink
Don't reload arenas.txt/*.arena files in Team Arena UI
Browse files Browse the repository at this point in the history
Entering Team Arena's start server or in-game callvote menu causes
arenas to be reloaded. The existing memory is not freed so after
a entering the menus a few times the UI runs out of memory and
crashes.

Just load arenas once when the UI loads like in q3_ui.
  • Loading branch information
zturtleman committed Sep 11, 2017
1 parent 213b15a commit dcf5707
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/ui/ui_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3263,7 +3263,6 @@ static void UI_RunMenuScript(char **args) {
trap_Cvar_Set("ui_cdkeyvalid", "CD Key does not appear to be valid.");
}
} else if (Q_stricmp(name, "loadArenas") == 0) {
UI_LoadArenas();
UI_MapCountByGameType(qfalse);
Menu_SetFeederSelection(NULL, FEEDER_ALLMAPS, 0, "createserver");
} else if (Q_stricmp(name, "saveControls") == 0) {
Expand Down Expand Up @@ -5165,6 +5164,7 @@ void _UI_Init( qboolean inGameLoad ) {
UI_ParseTeamInfo("teaminfo.txt");
UI_LoadTeams();
UI_ParseGameInfo("gameinfo.txt");
UI_LoadArenas();
#endif

menuSet = UI_Cvar_VariableString("ui_menuFiles");
Expand Down

0 comments on commit dcf5707

Please sign in to comment.