diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/script.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 7a7e15c249..1cc85b05c2 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -220,7 +220,11 @@ Script::Script(SagaEngine *vm) : _vm(vm) { // Shut down script module gracefully; free all allocated module resources Script::~Script() { - + ScriptThreadList::iterator threadIterator = _threadList.begin(); + while (threadIterator != _threadList.end()) { + delete *threadIterator; + threadIterator = _threadList.erase(threadIterator); + } } // Script opcodes |