diff options
author | yexo <yexo@openttd.org> | 2009-06-07 20:20:22 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-06-07 20:20:22 +0000 |
commit | 1df029de1d92895e8a28605fc84e7047e2e9b8af (patch) | |
tree | 85de3fb75e060a578a203615ce74d27f16eb75c3 /src/3rdparty | |
parent | 95f7c05199e4809162c0d959992e09e99876ffd3 (diff) | |
download | openttd-1df029de1d92895e8a28605fc84e7047e2e9b8af.tar.xz |
(svn r16534) -Fix [Squirrel] [FS#2942]: fix crash that occured when an AI was halted while one or more generators were still in a 'running' state
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/squirrel/squirrel/sqstate.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqstate.cpp b/src/3rdparty/squirrel/squirrel/sqstate.cpp index 52cea8a4c..c8747572d 100644 --- a/src/3rdparty/squirrel/squirrel/sqstate.cpp +++ b/src/3rdparty/squirrel/squirrel/sqstate.cpp @@ -189,8 +189,12 @@ SQSharedState::~SQSharedState() SQCollectable *t = _gc_chain; SQCollectable *nx = NULL; while(t) { - t->UnMark(); t->_uiRef++; + t = t->_next; + } + t = _gc_chain; + while(t) { + t->UnMark(); t->Finalize(); nx = t->_next; if(--t->_uiRef == 0) |