Make GFileIcon more robust
authorMatthias Clasen <mclasen@redhat.com>
Mon, 23 Dec 2013 20:00:55 +0000 (15:00 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 1 Jan 2014 22:59:20 +0000 (17:59 -0500)
No reason not to survive g_object_unref (g_object_new (...))

gio/gfileicon.c

index 0778107..b40ef00 100644 (file)
@@ -120,7 +120,8 @@ g_file_icon_finalize (GObject *object)
 
   icon = G_FILE_ICON (object);
 
-  g_object_unref (icon->file);
+  if (icon->file)
+    g_object_unref (icon->file);
 
   G_OBJECT_CLASS (g_file_icon_parent_class)->finalize (object);
 }