aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kscripts.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-05-13 23:01:02 +0200
committerWillem Jan Palenstijn2011-05-13 23:09:04 +0200
commitc01fed7159c313680e55458efb6529d332ebc8b0 (patch)
tree1b995f0f191e9e14200f1295ab3c78228ce3409b /engines/sci/engine/kscripts.cpp
parent3ed095434f471d1cecde2f8c2c805f7d22aed572 (diff)
downloadscummvm-rg350-c01fed7159c313680e55458efb6529d332ebc8b0.tar.gz
scummvm-rg350-c01fed7159c313680e55458efb6529d332ebc8b0.tar.bz2
scummvm-rg350-c01fed7159c313680e55458efb6529d332ebc8b0.zip
SCI: Avoid incrementing lockers of deleted script
Having a deleted script with non-zero lockers had the side effect of making the deleted script re-appear in the GC's work list, including any (deleted) objects in the script. This should be the root cause of bugs #3299458 and #3295849, so also delete the workaround added for that in 35086fe1.
Diffstat (limited to 'engines/sci/engine/kscripts.cpp')
-rw-r--r--engines/sci/engine/kscripts.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index c905f22050..b48de1c7ea 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -259,7 +259,7 @@ reg_t kDisposeScript(EngineState *s, int argc, reg_t *argv) {
SegmentId id = s->_segMan->getScriptSegment(script);
Script *scr = s->_segMan->getScriptIfLoaded(id);
- if (scr) {
+ if (scr && !scr->isMarkedAsDeleted()) {
if (s->_executionStack.back().addr.pc.segment != id)
scr->setLockers(1);
}