[devhelp] dh-book: improve finalize



commit ff1f0a49f995467150f8093a734378721c3780ac
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Thu Sep 19 15:02:39 2013 +0200

    dh-book: improve finalize

 src/dh-book.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/src/dh-book.c b/src/dh-book.c
index 9bc7e0d..fe33fde 100644
--- a/src/dh-book.c
+++ b/src/dh-book.c
@@ -108,19 +108,11 @@ dh_book_finalize (GObject *object)
                 g_node_destroy (priv->tree);
         }
 
-        if (priv->keywords) {
-                g_list_foreach (priv->keywords, (GFunc)dh_link_unref, NULL);
-                g_list_free (priv->keywords);
-        }
+        g_list_free_full (priv->keywords, (GDestroyNotify)dh_link_unref);
 
-        if (priv->completions) {
-                g_list_foreach (priv->completions, (GFunc)g_free, NULL);
-                g_list_free (priv->completions);
-        }
+        g_list_free_full (priv->completions, g_free);
 
-        if (priv->monitor) {
-                g_object_unref (priv->monitor);
-        }
+        g_clear_object (&priv->monitor);
 
         g_free (priv->language);
 



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