From 7c5b31eb6d6e53a91efb9e0575f07055ea626ed0 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 30 Jun 2010 07:28:30 +0000 Subject: Also erase the value of the list node itself when deleting it inside kDeleteKey, as it might be referenced again before the GC is invoked svn-id: r50516 --- engines/sci/engine/klists.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index ef2f40e235..6e01768958 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -346,9 +346,11 @@ reg_t kDeleteKey(EngineState *s, int argc, reg_t *argv) { if (!n->succ.isNull()) s->_segMan->lookupNode(n->succ)->pred = n->pred; - // Erase references to the predecessor and successor nodes + // Erase the node itself, as the game might reference it + // again before the GC is invoked n->pred = NULL_REG; n->succ = NULL_REG; + n->value = NULL_REG; return make_reg(0, 1); // Signal success } -- cgit v1.2.3