Merge remote-tracking branch 'remotes/zdoom/master'

This commit is contained in:
Christoph Oelckers 2016-09-13 23:37:30 +02:00
commit 0c0e716ccd
2 changed files with 11 additions and 0 deletions

View file

@ -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)

View file

@ -35,6 +35,7 @@
#include <string.h>
#include "name.h"
#include "c_dispatch.h"
#include "c_console.h"
// MACROS ------------------------------------------------------------------
@ -268,6 +269,8 @@ FName::NameManager::~NameManager()
{
NameBlock *block, *next;
C_ClearTabCommands();
for (block = Blocks; block != NULL; block = next)
{
next = block->NextBlock;