mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-21 19:51:27 +00:00
Clear Services Map during VM Shutdown
This commit is contained in:
parent
a8b8de94d6
commit
71d4eb66f2
2 changed files with 10 additions and 2 deletions
|
@ -231,6 +231,8 @@ void PClass::StaticInit ()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
|
void ClearServices();
|
||||||
|
|
||||||
void PClass::StaticShutdown ()
|
void PClass::StaticShutdown ()
|
||||||
{
|
{
|
||||||
if (WP_NOCHANGE != nullptr)
|
if (WP_NOCHANGE != nullptr)
|
||||||
|
@ -238,6 +240,7 @@ void PClass::StaticShutdown ()
|
||||||
delete WP_NOCHANGE;
|
delete WP_NOCHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClearServices();
|
||||||
// delete all variables containing pointers to script functions.
|
// delete all variables containing pointers to script functions.
|
||||||
for (auto p : FunctionPtrList)
|
for (auto p : FunctionPtrList)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
|
|
||||||
static ZSMap<FName, DObject*> AllServices;
|
static ZSMap<FName, DObject*> AllServices;
|
||||||
|
|
||||||
static void MarkServices() {
|
static void MarkServices()
|
||||||
|
{
|
||||||
ZSMap<FName, DObject*>::Iterator it(AllServices);
|
ZSMap<FName, DObject*>::Iterator it(AllServices);
|
||||||
ZSMap<FName, DObject*>::Pair* pair;
|
ZSMap<FName, DObject*>::Pair* pair;
|
||||||
while (it.NextPair(pair))
|
while (it.NextPair(pair))
|
||||||
|
@ -82,6 +82,11 @@ void InitServices()
|
||||||
GC::AddMarkerFunc(&MarkServices);
|
GC::AddMarkerFunc(&MarkServices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClearServices()
|
||||||
|
{
|
||||||
|
AllServices.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue