Commit 3b437b01 authored by Christian Persch's avatar Christian Persch Committed by Christian Persch
Browse files

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
parent 94129a4e
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
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment