From ba68cfd61153ed260ae1cf3c8dc7e4986ee4fa69 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Sep 2016 21:01:50 +0200 Subject: [PATCH] - do not even allow creation of names in C_RemoveTabCommands if there are no tab commands, so that FindName cannot be called after the NameManager has been destroyed. --- src/c_console.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/c_console.cpp b/src/c_console.cpp index 0868612292..2d164c4787 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -1747,6 +1747,14 @@ void C_AddTabCommand (const char *name) void C_RemoveTabCommand (const char *name) { + if (TabCommands.Size() == 0) + { + // There are no tab commands that can be removed. + // This is important to skip construction of aname + // in case the NameManager has already been destroyed. + return; + } + FName aname(name, true); if (aname == NAME_None)