[gtk+] tree view: clean up custom search entry on destroy



commit 67a00991b75641d3ef6bfa6e1376443d0afeb612
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 17 21:41:11 2014 -0500

    tree view: clean up custom search entry on destroy
    
    Suprisingly, this bug has been there for a very long time.
    I'm fixing it now because we now use a custom search entry
    in the app chooser dialog, and this is causing the templates
    cleanup test to fail.

 gtk/gtktreeview.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 7bf95e7..968a1bf 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2092,6 +2092,21 @@ gtk_tree_view_destroy (GtkWidget *widget)
        }
     }
 
+  if (tree_view->priv->search_custom_entry_set)
+    {
+      g_signal_handlers_disconnect_by_func (tree_view->priv->search_entry,
+                                            G_CALLBACK (gtk_tree_view_search_init),
+                                            tree_view);
+      g_signal_handlers_disconnect_by_func (tree_view->priv->search_entry,
+                                            G_CALLBACK (gtk_tree_view_search_key_press_event),
+                                            tree_view);
+
+      g_object_unref (tree_view->priv->search_entry);
+
+      tree_view->priv->search_entry = NULL;
+      tree_view->priv->search_custom_entry_set = FALSE;
+    }
+
   if (tree_view->priv->search_destroy && tree_view->priv->search_user_data)
     {
       tree_view->priv->search_destroy (tree_view->priv->search_user_data);
@@ -14856,6 +14871,7 @@ gtk_tree_view_set_search_entry (GtkTreeView *tree_view,
       gtk_widget_destroy (tree_view->priv->search_window);
 
       tree_view->priv->search_window = NULL;
+      tree_view->priv->search_entry_changed_id = 0;
     }
 
   if (entry)


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