diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index d3aa01ce67..d757aff7c6 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -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) { diff --git a/src/dobjtype.h b/src/dobjtype.h index 4bf4fccd99..bdcff573d4 100644 --- a/src/dobjtype.h +++ b/src/dobjtype.h @@ -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); };