[frogr/frogr-0.6.x: 7/9] fix generation of default icon list (#656519)



commit 13d0d459b3d7b4dc90dc8a1451de60b90b5156af
Author: Christophe Fergeau <teuf gnome org>
Date:   Sun Aug 14 16:12:06 2011 +0200

    fix generation of default icon list (#656519)
    
    frogr_main_view_init builds a list of icon to pass
    to gtk_window_set_default_icon_list. The generation of this list
    is incorrectly done, resulting in a series of 1-element lists
    being generated, leaking the previous list every time.
    This commit fixes the list generation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656519

 src/frogr-main-view.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index a0ffdab..140f938 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -1536,7 +1536,7 @@ frogr_main_view_init (FrogrMainView *self)
   GtkWidget *progress_label;
   const gchar *icons_path;
   gchar *full_path;
-  GList *icons;
+  GList *icons = NULL;
 
 #ifdef MAC_INTEGRATION
   GtkOSXApplication *osx_app;
@@ -1555,27 +1555,27 @@ frogr_main_view_init (FrogrMainView *self)
   /* Provide a default icon list in several sizes */
   icons_path = frogr_util_get_icons_dir ();
   full_path = g_strdup_printf ("%s/" MAIN_VIEW_ICON("128x128"), icons_path);
-  icons = g_list_prepend (NULL, gdk_pixbuf_new_from_file (full_path, NULL));
+  icons = g_list_prepend (icons, gdk_pixbuf_new_from_file (full_path, NULL));
   g_free (full_path);
 
   full_path = g_strdup_printf ("%s/" MAIN_VIEW_ICON("64x64"), icons_path);
-  icons = g_list_prepend (NULL, gdk_pixbuf_new_from_file (full_path, NULL));
+  icons = g_list_prepend (icons, gdk_pixbuf_new_from_file (full_path, NULL));
   g_free (full_path);
 
   full_path = g_strdup_printf ("%s/" MAIN_VIEW_ICON("48x48"), icons_path);
-  icons = g_list_prepend (NULL, gdk_pixbuf_new_from_file (full_path, NULL));
+  icons = g_list_prepend (icons, gdk_pixbuf_new_from_file (full_path, NULL));
   g_free (full_path);
 
   full_path = g_strdup_printf ("%s/" MAIN_VIEW_ICON("32x32"), icons_path);
-  icons = g_list_prepend (NULL, gdk_pixbuf_new_from_file (full_path, NULL));
+  icons = g_list_prepend (icons, gdk_pixbuf_new_from_file (full_path, NULL));
   g_free (full_path);
 
   full_path = g_strdup_printf ("%s/" MAIN_VIEW_ICON("24x24"), icons_path);
-  icons = g_list_prepend (NULL, gdk_pixbuf_new_from_file (full_path, NULL));
+  icons = g_list_prepend (icons, gdk_pixbuf_new_from_file (full_path, NULL));
   g_free (full_path);
 
   full_path = g_strdup_printf ("%s/" MAIN_VIEW_ICON("16x16"), icons_path);
-  icons = g_list_prepend (NULL, gdk_pixbuf_new_from_file (full_path, NULL));
+  icons = g_list_prepend (icons, gdk_pixbuf_new_from_file (full_path, NULL));
   g_free (full_path);
 
   gtk_window_set_default_icon_list (icons);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]