changeset 489:23c7667b3ec0 Android_Skia

Fix a potential bug when destroy a rdman. When a rdman is dirty, free shapes and coords works specially. Objects are append to a free list. They are not real freed until rdman being clean. redraw_man_destroy() free shapes and coords with free functions of them. If rdman is dirty when destroy it, objects would be leaked. The changeset make rdman clean before free shapes and coords to make objects being freed correctly.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 22 Nov 2009 20:41:27 +0800
parents aebfb7c7de46
children 5d0b2761f89c
files src/redraw_man.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/redraw_man.c	Sun Nov 22 18:24:17 2009 +0800
+++ b/src/redraw_man.c	Sun Nov 22 20:41:27 2009 +0800
@@ -710,6 +710,12 @@
     free_free_objs(rdman);
     free_objs_destroy(rdman);
 
+    /* Mark rdman clean that shapes and coords can be freed
+     *  successfully.
+     */
+    DARRAY_CLEAN(&rdman->dirty_coords);
+    DARRAY_CLEAN(&rdman->dirty_geos);
+
     coord = postorder_coord_subtree(rdman->root_coord, NULL);
     while(coord) {
 	saved_coord = coord;