mirror of https://github.com/OpenTTD/OpenTTD.git
(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
This commit is contained in:
parent
95f7c05199
commit
1df029de1d
|
@ -189,8 +189,12 @@ SQSharedState::~SQSharedState()
|
||||||
SQCollectable *t = _gc_chain;
|
SQCollectable *t = _gc_chain;
|
||||||
SQCollectable *nx = NULL;
|
SQCollectable *nx = NULL;
|
||||||
while(t) {
|
while(t) {
|
||||||
t->UnMark();
|
|
||||||
t->_uiRef++;
|
t->_uiRef++;
|
||||||
|
t = t->_next;
|
||||||
|
}
|
||||||
|
t = _gc_chain;
|
||||||
|
while(t) {
|
||||||
|
t->UnMark();
|
||||||
t->Finalize();
|
t->Finalize();
|
||||||
nx = t->_next;
|
nx = t->_next;
|
||||||
if(--t->_uiRef == 0)
|
if(--t->_uiRef == 0)
|
||||||
|
|
Loading…
Reference in New Issue