1
0
Fork 0

Fix #9353: [Script] Garbage collecting on priority queues could crash the game

pull/9365/head
rubidium42 2021-06-12 16:45:26 +02:00 committed by rubidium42
parent 40cec34836
commit 71f3c35288
2 changed files with 6 additions and 3 deletions

View File

@ -254,9 +254,12 @@ void ScriptInstance::GameLoop()
} }
} }
void ScriptInstance::CollectGarbage() const void ScriptInstance::CollectGarbage()
{ {
if (this->is_started && !this->IsDead()) this->engine->CollectGarbage(); if (this->is_started && !this->IsDead()) {
ScriptObject::ActiveInstance active(this);
this->engine->CollectGarbage();
}
} }
/* static */ void ScriptInstance::DoCommandReturn(ScriptInstance *instance) /* static */ void ScriptInstance::DoCommandReturn(ScriptInstance *instance)

View File

@ -68,7 +68,7 @@ public:
/** /**
* Let the VM collect any garbage. * Let the VM collect any garbage.
*/ */
void CollectGarbage() const; void CollectGarbage();
/** /**
* Get the storage of this script. * Get the storage of this script.