[gtk+] Fix memleak in filter model unit test



commit 855fee8f1f6ec34e631c2a8bdf47f4c38b0008aa
Author: Kristian Rietveld <kris gtk org>
Date:   Sat Sep 5 16:58:12 2009 +0200

    Fix memleak in filter model unit test
    
    (There is one larger memleak left here, but this is a side effect of the
    test case for bug 346800).

 gtk/tests/filtermodel.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/tests/filtermodel.c b/gtk/tests/filtermodel.c
index ab862ce..3f5cfb0 100644
--- a/gtk/tests/filtermodel.c
+++ b/gtk/tests/filtermodel.c
@@ -43,13 +43,18 @@ create_tree_store_set_values (GtkTreeStore *store,
                               gboolean      visible)
 {
   GtkTreePath *path;
+  gchar *path_string;
 
   path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter);
+  path_string = gtk_tree_path_to_string (path);
+
   gtk_tree_store_set (store, iter,
-                      0, gtk_tree_path_to_string (path),
+                      0, path_string,
                       1, visible,
                       -1);
+
   gtk_tree_path_free (path);
+  g_free (path_string);
 }
 
 static void



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