comparison src/redraw_man.c @ 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 ba64f928542b
children 5d0b2761f89c
comparison
equal deleted inserted replaced
488:aebfb7c7de46 489:23c7667b3ec0
708 mb_prop_store_destroy(&rdman->props); 708 mb_prop_store_destroy(&rdman->props);
709 709
710 free_free_objs(rdman); 710 free_free_objs(rdman);
711 free_objs_destroy(rdman); 711 free_objs_destroy(rdman);
712 712
713 /* Mark rdman clean that shapes and coords can be freed
714 * successfully.
715 */
716 DARRAY_CLEAN(&rdman->dirty_coords);
717 DARRAY_CLEAN(&rdman->dirty_geos);
718
713 coord = postorder_coord_subtree(rdman->root_coord, NULL); 719 coord = postorder_coord_subtree(rdman->root_coord, NULL);
714 while(coord) { 720 while(coord) {
715 saved_coord = coord; 721 saved_coord = coord;
716 coord = postorder_coord_subtree(rdman->root_coord, coord); 722 coord = postorder_coord_subtree(rdman->root_coord, coord);
717 FORMEMBERS(saved_coord, member) { 723 FORMEMBERS(saved_coord, member) {