From 50a352b3670e6b8e8d29a9559d2442fcf0b62c5e Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Fri, 10 Jan 2003 01:38:32 +0000 Subject: deal with backends that might not have loaded successfully (they'll have a 2003-01-09 Chris Toshok * backend/pas/pas-book-factory.c (backend_last_client_gone_cb): deal with backends that might not have loaded successfully (they'll have a NULL uri). svn path=/trunk/; revision=19385 --- addressbook/ChangeLog | 6 ++++++ addressbook/backend/pas/pas-book-factory.c | 25 +++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 49f1a59978..8dacf693d9 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +2003-01-09 Chris Toshok + + * backend/pas/pas-book-factory.c (backend_last_client_gone_cb): + deal with backends that might not have loaded successfully + (they'll have a NULL uri). + 2003-01-09 Chris Toshok * gui/component/select-names/e-select-names-bonobo.c diff --git a/addressbook/backend/pas/pas-book-factory.c b/addressbook/backend/pas/pas-book-factory.c index e775553958..5a258edcfe 100644 --- a/addressbook/backend/pas/pas-book-factory.c +++ b/addressbook/backend/pas/pas-book-factory.c @@ -143,29 +143,30 @@ backend_last_client_gone_cb (PASBackend *backend, gpointer data) { PASBookFactory *factory; const char *uri; - gpointer orig_key; - gboolean result; - char *orig_uri; factory = PAS_BOOK_FACTORY (data); /* Remove the backend from the active server map */ uri = pas_backend_get_uri (backend); - g_assert (uri != NULL); + if (uri) { + gpointer orig_key; + gboolean result; + char *orig_uri; - result = g_hash_table_lookup_extended (factory->priv->active_server_map, uri, - &orig_key, NULL); - g_assert (result != FALSE); + result = g_hash_table_lookup_extended (factory->priv->active_server_map, uri, + &orig_key, NULL); + g_assert (result != FALSE); - orig_uri = orig_key; + orig_uri = orig_key; - g_hash_table_remove (factory->priv->active_server_map, orig_uri); - g_free (orig_uri); + g_hash_table_remove (factory->priv->active_server_map, orig_uri); + g_free (orig_uri); - g_object_unref (backend); + g_object_unref (backend); - /* Notify upstream if there are no more backends */ + /* Notify upstream if there are no more backends */ + } if (g_hash_table_size (factory->priv->active_server_map) == 0) g_signal_emit (G_OBJECT (factory), factory_signals[LAST_BOOK_GONE], 0); -- cgit v1.2.3