summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/3rdparty/squirrel/squirrel/sqstate.cpp6
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)