diff options
author | rubidium <rubidium@openttd.org> | 2009-02-03 22:42:42 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-03 22:42:42 +0000 |
commit | 1c30c8c801d2b4ecc6901069dcdfa8d0411aa1fd (patch) | |
tree | 4f0ff072e810fbda1bd6a01083ab7be1081bfdf3 /src/ai/ai_instance.cpp | |
parent | 101f55e65cd43daea211b26b5fe5666968a507f4 (diff) | |
download | openttd-1c30c8c801d2b4ecc6901069dcdfa8d0411aa1fd.tar.xz |
(svn r15330) -Fix [FS#2597]: leaking of Squirrel when using circular references (by enabling the GC).
Diffstat (limited to 'src/ai/ai_instance.cpp')
-rw-r--r-- | src/ai/ai_instance.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 26d55481b..37529eeab 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -296,6 +296,11 @@ void AIInstance::GameLoop() } } +void AIInstance::CollectGarbage() +{ + if (this->is_started && !this->is_dead) this->engine->CollectGarbage(); +} + /* static */ void AIInstance::DoCommandReturn(AIInstance *instance) { instance->engine->InsertResult(AIObject::GetLastCommandRes()); |