[gtranslator] Use g_slist_free_full where possible.



commit 1f1e4672122b5cf78344d0ea87c18ce8e24d94cc
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]