Silently handle icon being NULL
authorMatthias Clasen <mclasen@redhat.com>
Fri, 3 May 2013 01:00:57 +0000 (21:00 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 5 May 2013 01:12:48 +0000 (21:12 -0400)
While an emblemed icon without a base icon is not very
useful, no need to crash here.
This was crashing the object finalization test in gtk.

gio/gemblemedicon.c

index c10dc9b..f100a8e 100644 (file)
@@ -72,7 +72,7 @@ g_emblemed_icon_finalize (GObject *object)
 
   emblemed = G_EMBLEMED_ICON (object);
 
-  g_object_unref (emblemed->priv->icon);
+  g_clear_object (&emblemed->priv->icon);
   g_list_free_full (emblemed->priv->emblems, g_object_unref);
 
   (*G_OBJECT_CLASS (g_emblemed_icon_parent_class)->finalize) (object);