aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-05-30 19:59:53 +0000
committerWillem Jan Palenstijn2009-05-30 19:59:53 +0000
commit598feb771fffcdbe94feebe8889162e668e41fcc (patch)
tree0c889dd13d3818a6d52f9844c9b01b6414d75717 /engines
parenta126a05dc4a6f98ced644b9ed789a520b19976f3 (diff)
downloadscummvm-rg350-598feb771fffcdbe94feebe8889162e668e41fcc.tar.gz
scummvm-rg350-598feb771fffcdbe94feebe8889162e668e41fcc.tar.bz2
scummvm-rg350-598feb771fffcdbe94feebe8889162e668e41fcc.zip
SCI: Fix broken pointer after array re-allocation.
svn-id: r41042
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kgraphics.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 262b4b5e14..5c9058c09c 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1967,10 +1967,10 @@ static void _k_make_view_list(EngineState *s, GfxList **widget_list, List *list,
error("Attempt to make list from non-list!\n");
}
- node = lookup_node(s, list->first);
+ reg_t next_node = list->first;
+ node = lookup_node(s, next_node);
while (node) {
reg_t obj = node->value; // The object we're using
- reg_t next_node;
GfxDynView *tempWidget;
if (options & _K_MAKE_VIEW_LIST_CYCLE) {
@@ -1980,6 +1980,11 @@ static void _k_make_view_list(EngineState *s, GfxList **widget_list, List *list,
debugC(2, kDebugLevelGraphics, " invoking %04x:%04x::doit()\n", PRINT_REG(obj));
invoke_selector(INV_SEL(obj, doit, 1), 0); // Call obj::doit() if neccessary
+
+
+ // Lookup node again, since the NodeTable it was in may
+ // have been re-allocated.
+ node = lookup_node(s, next_node);
}
}