From 69a603caccc4f331d8fc4855318627abaefb4273 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 4 Oct 2004 14:47:03 +0000 Subject: [PATCH] Ref the new icons before unreffing the old ones. (#154468, Morten 2004-10-04 Matthias Clasen * gtk/gtkwindow.c (gtk_window_set_icon_list): Ref the new icons before unreffing the old ones. (#154468, Morten Welinder) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkwindow.c | 11 +++++++---- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72b10b5b10..db0ad27b38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-10-04 Matthias Clasen + + * gtk/gtkwindow.c (gtk_window_set_icon_list): Ref the new icons + before unreffing the old ones. (#154468, Morten Welinder) + 2004-10-03 Matthias Clasen * gtk/gtkiconview.c (gtk_icon_view_set_model): Reset pointers diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 72b10b5b10..db0ad27b38 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2004-10-04 Matthias Clasen + + * gtk/gtkwindow.c (gtk_window_set_icon_list): Ref the new icons + before unreffing the old ones. (#154468, Morten Welinder) + 2004-10-03 Matthias Clasen * gtk/gtkiconview.c (gtk_icon_view_set_model): Reset pointers diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 72b10b5b10..db0ad27b38 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2004-10-04 Matthias Clasen + + * gtk/gtkwindow.c (gtk_window_set_icon_list): Ref the new icons + before unreffing the old ones. (#154468, Morten Welinder) + 2004-10-03 Matthias Clasen * gtk/gtkiconview.c (gtk_icon_view_set_model): Reset pointers diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 72b10b5b10..db0ad27b38 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2004-10-04 Matthias Clasen + + * gtk/gtkwindow.c (gtk_window_set_icon_list): Ref the new icons + before unreffing the old ones. (#154468, Morten Welinder) + 2004-10-03 Matthias Clasen * gtk/gtkiconview.c (gtk_icon_view_set_model): Reset pointers diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 01509ba21f..2066357034 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -2653,11 +2653,11 @@ icon_list_from_theme (GtkWidget *widget, icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget)); sizes = gtk_icon_theme_get_icon_sizes (icon_theme, name); - list = NULL; + list = NULL; for (i = 0; sizes[i]; i++) { - /* FIXME + /* FIXME * We need an EWMH extension to handle scalable icons * by passing their name to the WM. For now just use a * fixed size of 48. @@ -2672,6 +2672,8 @@ icon_list_from_theme (GtkWidget *widget, list = g_list_append (list, icon); } + g_free (sizes); + return list; } @@ -2852,14 +2854,15 @@ gtk_window_set_icon_list (GtkWindow *window, if (info->icon_list == list) /* check for NULL mostly */ return; + g_list_foreach (list, + (GFunc) g_object_ref, NULL); + g_list_foreach (info->icon_list, (GFunc) g_object_unref, NULL); g_list_free (info->icon_list); info->icon_list = g_list_copy (list); - g_list_foreach (info->icon_list, - (GFunc) g_object_ref, NULL); g_object_notify (G_OBJECT (window), "icon");