From 2f7570cfbdab2ce5d4fe960feee6bb4eacf06001 Mon Sep 17 00:00:00 2001 From: Arnaud Renevier Date: Sat, 19 Jul 2008 05:58:32 +0200 Subject: [PATCH] Disconnect handlers when destroying the treeview --- midori/midori-searchentry.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/midori/midori-searchentry.c b/midori/midori-searchentry.c index cb8680e8..de498d29 100644 --- a/midori/midori-searchentry.c +++ b/midori/midori-searchentry.c @@ -737,6 +737,18 @@ midori_search_entry_dialog_engines_remove_item_cb (MidoriWebList* web_list, } } +static void +midori_search_entry_treeview_destroy_cb (GtkWidget* treeview, + GtkWidget* search_entry) +{ + g_signal_handlers_disconnect_by_func ( + MIDORI_SEARCH_ENTRY (search_entry)->search_engines, + midori_search_entry_dialog_engines_add_item_cb, treeview); + g_signal_handlers_disconnect_by_func ( + MIDORI_SEARCH_ENTRY (search_entry)->search_engines, + midori_search_entry_dialog_engines_remove_item_cb, treeview); +} + /** * midori_search_entry_get_dialog: * @search_entry: a #MidoriSearchEntry @@ -836,6 +848,8 @@ midori_search_entry_get_dialog (MidoriSearchEntry* search_entry) NULL, i, 0, web_item, -1); } g_object_unref (liststore); + g_signal_connect (treeview, "destroy", + G_CALLBACK (midori_search_entry_treeview_destroy_cb), search_entry); vbox = gtk_vbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 4); button = gtk_button_new_from_stock (GTK_STOCK_ADD);