[Scummvm-cvs-logs] SF.net SVN: scummvm:[41042] scummvm/trunk/engines/sci/engine/kgraphics.cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sat May 30 21:59:53 CEST 2009


Revision: 41042
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41042&view=rev
Author:   wjpalenstijn
Date:     2009-05-30 19:59:53 +0000 (Sat, 30 May 2009)

Log Message:
-----------
SCI: Fix broken pointer after array re-allocation.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-30 19:48:13 UTC (rev 41041)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-30 19:59:53 UTC (rev 41042)
@@ -1967,10 +1967,10 @@
 		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 @@
 
 				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);
 			}
 		}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list