[gtk+/gtk-3-8] icon-theme: Use g_clear_* helpers in finalize



commit ad29977bf71c4e1f8a834ca8c09c437ad4d233f4
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 2 14:28:00 2013 +0200

    icon-theme: Use g_clear_* helpers in finalize
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709264

 gtk/gtkicontheme.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index ccbb8b6..87c41ef 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3146,15 +3146,11 @@ gtk_icon_info_finalize (GObject *object)
   g_free (icon_info->filename);
   g_clear_object (&icon_info->icon_file);
 
-  if (icon_info->loadable)
-    g_object_unref (icon_info->loadable);
+  g_clear_object (&icon_info->loadable);
   g_slist_free_full (icon_info->emblem_infos, (GDestroyNotify) g_object_unref);
-  if (icon_info->pixbuf)
-    g_object_unref (icon_info->pixbuf);
-  if (icon_info->cache_pixbuf)
-    g_object_unref (icon_info->cache_pixbuf);
-  if (icon_info->symbolic_pixbuf_size)
-    gtk_requisition_free (icon_info->symbolic_pixbuf_size);
+  g_clear_object (&icon_info->pixbuf);
+  g_clear_object (&icon_info->cache_pixbuf);
+  g_clear_pointer (&icon_info->symbolic_pixbuf_size, gtk_requisition_free);
   icon_data_unref (icon_info->data);
 
   symbolic_pixbuf_cache_free (icon_info->symbolic_pixbuf_cache);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]