[gtk+] icon-theme: Use g_clear_* helpers in finalize
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] icon-theme: Use g_clear_* helpers in finalize
- Date: Wed, 2 Oct 2013 15:22:08 +0000 (UTC)
commit 7c595bcc53ff4d7d7b4595966c2a40b1d92b4413
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 8345614..e163d43 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3413,15 +3413,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]