mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-29 09:29:10 +00:00
(svn r15659) -Fix [Squirrel]: The garbage collection would sometimes loop (2^32 - small_value) times instead of only small_value times.
This commit is contained in:
3
src/3rdparty/squirrel/squirrel/sqstate.cpp
vendored
3
src/3rdparty/squirrel/squirrel/sqstate.cpp
vendored
@@ -189,6 +189,7 @@ 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->Finalize();
|
t->Finalize();
|
||||||
nx = t->_next;
|
nx = t->_next;
|
||||||
@@ -198,7 +199,7 @@ SQSharedState::~SQSharedState()
|
|||||||
}
|
}
|
||||||
// assert(_gc_chain==NULL); //just to proove a theory
|
// assert(_gc_chain==NULL); //just to proove a theory
|
||||||
while(_gc_chain){
|
while(_gc_chain){
|
||||||
_gc_chain->_uiRef++;
|
_gc_chain->_uiRef--;
|
||||||
_gc_chain->Release();
|
_gc_chain->Release();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user