[nautilus] query-editor: plug a leak



commit 39b0e7d240c6638bb2e869062ba90468c4983f69
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Nov 12 15:53:41 2012 -0500

    query-editor: plug a leak
    
    We weren't freeing the row list and all the row structs.

 src/nautilus-query-editor.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index ca1013f..b9fecd3 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -238,6 +238,13 @@ nautilus_query_editor_handle_event (NautilusQueryEditor *editor,
 }
 
 static void
+row_destroy (NautilusQueryEditorRow *row)
+{
+	gtk_widget_destroy (row->toolbar);
+	g_free (row);
+}
+
+static void
 nautilus_query_editor_dispose (GObject *object)
 {
 	NautilusQueryEditor *editor;
@@ -251,6 +258,9 @@ nautilus_query_editor_dispose (GObject *object)
 
 	g_clear_object (&editor->details->query);
 
+	g_list_free_full (editor->details->rows, (GDestroyNotify) row_destroy);
+	editor->details->rows = NULL;
+
 	G_OBJECT_CLASS (nautilus_query_editor_parent_class)->dispose (object);
 }
 
@@ -856,13 +866,6 @@ get_next_free_type (NautilusQueryEditor *editor)
 }
 
 static void
-row_destroy (NautilusQueryEditorRow *row)
-{
-	gtk_widget_destroy (row->toolbar);
-	g_free (row);
-}
-
-static void
 remove_row_cb (GtkButton *clicked_button, NautilusQueryEditorRow *row)
 {
 	NautilusQueryEditor *editor;



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