[gtranslator/gtk3] Use g_slist_free_full where possible.



commit f077a4c9600f92153f1434010d986ddc0740e438
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Nov 8 00:42:42 2010 +0100

    Use g_slist_free_full where possible.

 plugins/insert-params/gtr-insert-params-plugin.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/plugins/insert-params/gtr-insert-params-plugin.c b/plugins/insert-params/gtr-insert-params-plugin.c
index f04f7e7..db973a7 100644
--- a/plugins/insert-params/gtr-insert-params-plugin.c
+++ b/plugins/insert-params/gtr-insert-params-plugin.c
@@ -162,7 +162,7 @@ gtr_insert_params_plugin_dispose (GObject *object)
 static void
 gtr_insert_params_plugin_finalize (GObject *object)
 {
-  g_slist_free (params);
+  g_slist_free_full (params, g_free);
   params = NULL;
 
   G_OBJECT_CLASS (gtr_insert_params_plugin_parent_class)->finalize (object);
@@ -280,12 +280,8 @@ showed_message_cb (GtrTab * tab, GtrMsg * msg, GtrWindow * window)
   gchar *word;
   gint i;
 
-  if (params != NULL)
-    {
-      g_slist_foreach (params, (GFunc) g_free, NULL);
-      g_slist_free (params);
-      params = NULL;
-    }
+  g_slist_free_full (params, g_free);
+  params = NULL;
 
   /*
    * If we show another message we have to restart the index



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