Bug 577224 – crash when setting new icon after setting icon in

2009-03-29  Christian Persch  <chpe@gnome.org>

	Bug 577224 – crash when setting new icon after setting icon in
	gtkstatusicon

	* gtk/gtkstatusicon.c: (gtk_status_icon_reset_image_data),
	(gtk_status_icon_set_from_gicon): Retain a reference when setting
	from a GIcon, and use g_object_unref on GIcon, not g_free.

svn path=/trunk/; revision=22594
This commit is contained in:
Christian Persch 2009-03-29 21:25:13 +00:00 committed by Christian Persch
parent 94129a4e2b
commit 3b437b016c
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2009-03-29 Christian Persch <chpe@gnome.org>
Bug 577224 crash when setting new icon after setting icon in
gtkstatusicon
* gtk/gtkstatusicon.c: (gtk_status_icon_reset_image_data),
(gtk_status_icon_set_from_gicon): Retain a reference when setting
from a GIcon, and use g_object_unref on GIcon, not g_free.
2009-03-27 Behdad Esfahbod <behdad@gnome.org>
Bug 437533 Implement draw_shape PangoRenderer method

View File

@ -1780,7 +1780,8 @@ gtk_status_icon_reset_image_data (GtkStatusIcon *status_icon)
break;
case GTK_IMAGE_GICON:
g_free (priv->image_data.gicon);
if (priv->image_data.gicon)
g_object_unref (priv->image_data.gicon);
priv->image_data.gicon = NULL;
g_object_notify (G_OBJECT (status_icon), "gicon");
@ -1949,6 +1950,9 @@ gtk_status_icon_set_from_gicon (GtkStatusIcon *status_icon,
g_return_if_fail (GTK_IS_STATUS_ICON (status_icon));
g_return_if_fail (icon != NULL);
if (icon)
g_object_ref (icon);
gtk_status_icon_set_image (status_icon, GTK_IMAGE_GICON,
(gpointer) icon);
}