From d86c247a2ee0546f11ebe8cb762e782cca287a35 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Mon, 11 Oct 2004 18:58:44 +0000 Subject: Don't unref the view - removing it from the hash table will do this for 2004-10-11 Hans Petter Jansson * gui/component/addressbook-view.c (source_list_changed_cb): Don't unref the view - removing it from the hash table will do this for us. Remove from hash table after removing the notebook page. (addressbook_view_init): Unref views when removed from the hash table. svn path=/trunk/; revision=27539 --- addressbook/gui/component/addressbook-view.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'addressbook/gui/component') diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c index 61a219f62e..0a51af0c43 100644 --- a/addressbook/gui/component/addressbook-view.c +++ b/addressbook/gui/component/addressbook-view.c @@ -498,11 +498,10 @@ source_list_changed_cb (ESourceList *source_list, AddressbookView *view) view remove it from our hash table. */ v = g_hash_table_lookup (priv->uid_to_view, uid); - g_hash_table_remove (priv->uid_to_view, uid); gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook), GTK_WIDGET (v))); - g_object_unref (v); + g_hash_table_remove (priv->uid_to_view, uid); } } g_list_free (uids); @@ -1067,7 +1066,7 @@ addressbook_view_init (AddressbookView *view) priv->gconf_client = addressbook_component_peek_gconf_client (addressbook_component_peek ()); - priv->uid_to_view = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, NULL); + priv->uid_to_view = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)g_object_unref); priv->uid_to_editor = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)g_free); priv->notebook = gtk_notebook_new (); -- cgit v1.2.3