Fix:core:Three memleaks fixed.
authormdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 6 Jun 2012 21:34:19 +0000 (21:34 +0000)
committermdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 6 Jun 2012 21:34:19 +0000 (21:34 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5136 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/graphics.c
navit/navit/gui/internal/gui_internal.c

index b626962..de9aa23 100644 (file)
@@ -2316,6 +2316,7 @@ void graphics_displaylist_draw(struct graphics *gra, struct displaylist *display
        if (l) {
                graphics_gc_set_background(gra->gc[0], &l->color);
                graphics_gc_set_foreground(gra->gc[0], &l->color);
+               g_free(gra->default_font);
                gra->default_font = g_strdup(l->font);
        }
        graphics_background_gc(gra, gra->gc[0]);
index 6f5daf6..f937a5e 100644 (file)
@@ -7302,12 +7302,8 @@ void gui_internal_table_pack(struct gui_priv * this, struct widget * w)
        /**
         * Deallocate column descriptions.
         */
-       current = column_data;
-       while( (current = g_list_last(current)) )
-       {
-               current = g_list_remove(current,current->data);
-       }
-
+       g_list_foreach(column_data,(GFunc)g_free,NULL);
+       g_list_free(column_data);
 }
 
 
@@ -7480,11 +7476,8 @@ void gui_internal_table_render(struct gui_priv * this, struct widget * w)
        /**
         * Deallocate column descriptions.
         */
-       current_desc = column_desc;
-       while( (current_desc = g_list_last(current_desc)) )
-       {
-               current_desc = g_list_remove(current_desc,current_desc->data);
-       }
+       g_list_foreach(column_desc,(GFunc)g_free,NULL);
+       g_list_free(column_desc);
 }