- Clear the TypeTable on shutdown so that the objects in it can be collected.

SVN r2301 (scripting)
This commit is contained in:
Randy Heit 2010-04-24 03:10:58 +00:00
parent dde5e1928f
commit 50d126e78b
2 changed files with 16 additions and 0 deletions

View File

@ -790,6 +790,7 @@ void PClass::StaticShutdown ()
{
delete[] uniqueFPs[i];
}
TypeTable.Clear();
bShutdown = true;
}
@ -1321,6 +1322,20 @@ void FTypeTable::Mark()
}
}
//==========================================================================
//
// FTypeTable :: Clear
//
// Removes everything from the table. We let the garbage collector worry
// about deleting them.
//
//==========================================================================
void FTypeTable::Clear()
{
memset(TypeHash, 0, sizeof(TypeHash));
}
#include "c_dispatch.h"
CCMD(typetable)
{

View File

@ -529,6 +529,7 @@ struct FTypeTable
void AddType(PType *type, PClass *metatype, const void *parm1, const void *parm2, size_t bucket);
void AddType(PType *type);
void Mark();
void Clear();
static size_t Hash(const void *p1, const void *p2, const void *p3);
};