# HG changeset patch # User Thinker K.F. Li # Date 1258893687 -28800 # Node ID 23c7667b3ec0937e6347fea0108849b5d0974377 # Parent aebfb7c7de4698d5a98d423273124da1d27882a5 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. diff -r aebfb7c7de46 -r 23c7667b3ec0 src/redraw_man.c --- 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;