]> Pileus Git - ~andy/gtk/commitdiff
Bug 577224 – crash when setting new icon after setting icon in
authorChristian Persch <chpe@gnome.org>
Sun, 29 Mar 2009 21:25:13 +0000 (21:25 +0000)
committerChristian Persch <chpe@src.gnome.org>
Sun, 29 Mar 2009 21:25:13 +0000 (21:25 +0000)
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

ChangeLog
gtk/gtkstatusicon.c

index adfb0e1d0a9c998eb34655afd3eaaf2c927048f3..898a5696f8ee13fad1084ae182e797b0412985a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 83bdb2cc5cb7b100d24d97874bb5615495cecca9..f2ed5012a150c7378b47d92499254b0433a43c17 100644 (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);
 }