aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWalter van Niftrik2010-02-06 04:13:00 +0000
committerWalter van Niftrik2010-02-06 04:13:00 +0000
commit38b0a148e6e5c0b09799074c8e27b8a42a7e593f (patch)
tree0874df2ba6c4430c27e1f7cad6f92febdca32881 /engines
parentf1f277d56dc308108d33bc323c2bf1d9a79f47ff (diff)
downloadscummvm-rg350-38b0a148e6e5c0b09799074c8e27b8a42a7e593f.tar.gz
scummvm-rg350-38b0a148e6e5c0b09799074c8e27b8a42a7e593f.tar.bz2
scummvm-rg350-38b0a148e6e5c0b09799074c8e27b8a42a7e593f.zip
SCI: Don't call garbage collector directly from kFlushResources() as this is no longer safe.
svn-id: r47925
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kmisc.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index bd1cf587ea..0c190d0e94 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -159,7 +159,11 @@ reg_t kMemorySegment(EngineState *s, int argc, reg_t *argv) {
}
reg_t kFlushResources(EngineState *s, int argc, reg_t *argv) {
- run_gc(s);
+ // We used to call run_gc() directly from here. This is no longer safe
+ // as we now always add our fake "kernel" stack frame for debugging
+ // purposes. Instead of calling run_gc(), we set gc_countdown to 1
+ // to make the garbage collector run before the next kernel function.
+ s->gc_countdown = 1;
debugC(2, kDebugLevelRoom, "Entering room number %d", argv[0].toUint16());
return s->r_acc;
}