diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/script/script_instance.cpp | 7 | ||||
-rw-r--r-- | src/script/script_instance.hpp | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 7c2fa43d6..c354126ca 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -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) diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index 4709c44e2..7db4f5ea8 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -68,7 +68,7 @@ public: /** * Let the VM collect any garbage. */ - void CollectGarbage() const; + void CollectGarbage(); /** * Get the storage of this script. |