From cd1747a8295ad64a28ab3c6c8d40de77e57dbb2a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 8 May 2007 10:13:28 +0100 Subject: Do not leak the query object on dispose Call search_stop_searching() with remove_query set to TRUE; also, sync the function prototype declaration with its implementation and test for the argument instead of getting the value off the struct. Signed-off-by: Emmanuele Bassi --- gtk/gtkfilechooserdefault.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 364589d..bc7ed91 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -457,7 +457,7 @@ static void location_button_toggled_cb (GtkToggleButton *toggle, static void location_switch_to_path_bar (GtkFileChooserDefault *impl); static void search_stop_searching (GtkFileChooserDefault *impl, - gboolean destroy_query); + gboolean remove_query); static void search_clear_model (GtkFileChooserDefault *impl, gboolean remove_from_treeview); static gboolean search_should_respond (GtkFileChooserDefault *impl); @@ -908,7 +908,7 @@ gtk_file_chooser_default_finalize (GObject *object) if (impl->sort_model) g_object_unref (impl->sort_model); - search_clear_model (impl, FALSE); + search_clear_model (impl, TRUE); g_free (impl->preview_display_name); @@ -8580,7 +8580,7 @@ static void search_stop_searching (GtkFileChooserDefault *impl, gboolean remove_query) { - if (impl->search_query && remove_query) + if (remove_query && impl->search_query) { g_object_unref (impl->search_query); impl->search_query = NULL; -- 1.4.4.2