From 91d11444f45fca76b12ece22e853dcb9dcf6da03 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 18 May 2006 16:50:49 +0000 Subject: [PATCH] Only unref the pixbuf if the image has the appropriate storage type. 2006-05-18 Matthias Clasen * gtk/gtkimage.c (icon_theme_changed): Only unref the pixbuf if the image has the appropriate storage type. (#342096, Tommi Komulainen) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ gtk/gtkimage.c | 11 +++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4bc2c76074..e82e1bd118 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-05-18 Matthias Clasen + * gtk/gtkimage.c (icon_theme_changed): Only unref the pixbuf + if the image has the appropriate storage type. (#342096, Tommi + Komulainen) + * configure.in: Actually require GLib 2.11 * gtk/gtkentry.c (gtk_entry_drag_data_received): Make drops diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4bc2c76074..e82e1bd118 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2006-05-18 Matthias Clasen + * gtk/gtkimage.c (icon_theme_changed): Only unref the pixbuf + if the image has the appropriate storage type. (#342096, Tommi + Komulainen) + * configure.in: Actually require GLib 2.11 * gtk/gtkentry.c (gtk_entry_drag_data_received): Make drops diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index d9a85ea2bd..6e5509e9af 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -1383,11 +1383,14 @@ animation_timeout (gpointer data) static void icon_theme_changed (GtkImage *image) { - if (image->data.name.pixbuf) - g_object_unref (image->data.name.pixbuf); - image->data.name.pixbuf = NULL; + if (image->storage_type == GTK_IMAGE_ICON_NAME) + { + if (image->data.name.pixbuf) + g_object_unref (image->data.name.pixbuf); + image->data.name.pixbuf = NULL; - gtk_widget_queue_draw (GTK_WIDGET (image)); + gtk_widget_queue_draw (GTK_WIDGET (image)); + } } static void