mirror of https://github.com/OpenTTD/OpenTTD
Fix #9353: [Script] Garbage collecting on priority queues could crash the game
parent
40cec34836
commit
71f3c35288
|
@ -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)
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue