changeset 817:387d1c597632

Change order of statements to fix bug of wild pointers. For some reason, the code is broken for merging from Android_Skia branch. The variable 'coord' in add_rdman_aggr_dirty_areas() is used before initialized; it is a wild pointer.
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 13 Sep 2010 15:33:19 +0800
parents 0e56a1ca19b2
children 86f2c59cef09
files src/redraw_man.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/redraw_man.c	Mon Sep 13 13:25:34 2010 +0800
+++ b/src/redraw_man.c	Mon Sep 13 15:33:19 2010 +0800
@@ -1852,11 +1852,12 @@
     n_zeroing = rdman->zeroing_coords.num;
     zeroings = rdman->zeroing_coords.ds;
     for(i = 0; i < n_zeroing; i++) {
+	coord = zeroings[i];
+	
 	if(coord_get_flags(coord, COF_TEMP_MARK))
 	    continue;
 	coord_set_flags(coord, COF_TEMP_MARK);
 	
-	coord = zeroings[i];
 	pcached_coord = coord_get_cached(coord_get_parent(coord));
 	
 	if(coord_is_root(coord) || IS_CACHE_REDRAW_ALL(pcached_coord))
@@ -2804,7 +2805,7 @@
     rdman_add_shape(rdman, (shape_t *)sh, coord2);
     rdman_shape_changed(rdman, (shape_t *)sh);
 
-    clean_rdman_coords(rdman);
+    rdman_clean_dirties(rdman);
 
     /* Parent cached coord must be updated */
     CU_ASSERT(_coord_get_dirty_areas(rdman->root_coord)->num >= 1);