Fix #9353: [Script] Garbage collecting on priority queues could crash the game
(cherry picked from commit 71f3c35288
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
d46c764d60
commit
057e858d32
@@ -278,9 +278,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.
|
||||||
|
Reference in New Issue
Block a user