summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-11-12 15:53:41 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2012-11-12 16:21:15 -0500
commit39b0e7d240c6638bb2e869062ba90468c4983f69 (patch)
tree11b00322ef246be74ca555836f8df69d96bc7680
parent95ec145831d862f8c3279872b4fdb3ba8db97097 (diff)
downloadnautilus-39b0e7d240c6638bb2e869062ba90468c4983f69.tar.gz
query-editor: plug a leak
We weren't freeing the row list and all the row structs.
-rw-r--r--src/nautilus-query-editor.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index ca1013f17..b9fecd327 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;