mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-15 23:21:46 +00:00
- Clear the TypeTable on shutdown so that the objects in it can be collected.
SVN r2301 (scripting)
This commit is contained in:
parent
dde5e1928f
commit
50d126e78b
2 changed files with 16 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue