Re: [evolution-patches] Exchange crash fix



Looks fine.

-Sushma.

Ahmed Sarfraaz wrote:

Exchange was crashing randomly while closing evolution. The gconf
notifier was not getting removed while quitting and this was causing the
crash. The attached patch fixes this.
Also added 2 minor changes for offline check in this patch.

Thanks
-- Sarfraaz
------------------------------------------------------------------------

Index: storage/exchange-account.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/storage/exchange-account.c,v
retrieving revision 1.39
diff -u -p -u -r1.39 exchange-account.c
--- storage/exchange-account.c	11 Mar 2005 07:50:21 -0000	1.39
+++ storage/exchange-account.c	29 Mar 2005 08:45:02 -0000
@@ -1127,15 +1129,12 @@ exchange_account_set_offline (ExchangeAc
gboolean
exchange_account_set_online (ExchangeAccount *account)
{
+	E2kContext *ctx;
	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), FALSE);

	if (!account->priv->account_online) {
-		account->priv->account_online = TRUE;
-
-		if (exchange_account_connect (account))
-			return TRUE;
-		else
-			return FALSE;
+		ctx = exchange_account_connect (account);
+		return ctx ? TRUE : FALSE;
	} else {
		return TRUE;
	}
Index: storage/exchange-hierarchy-somedav.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/storage/exchange-hierarchy-somedav.c,v
retrieving revision 1.7
diff -u -p -u -r1.7 exchange-hierarchy-somedav.c
--- storage/exchange-hierarchy-somedav.c	26 Feb 2005 14:19:16 -0000	1.7
+++ storage/exchange-hierarchy-somedav.c	29 Mar 2005 08:45:02 -0000
@@ -137,9 +137,7 @@ scan_subtree (ExchangeHierarchy *hier, E
		return EXCHANGE_ACCOUNT_FOLDER_OK;
	hsd->priv->scanned = TRUE;

-	/*FIXME : Not sure if this is the right place for this */
-	exchange_account_is_offline (hier->account, &mode);
-	if (mode != ONLINE_MODE)
+	if (offline)
		return EXCHANGE_ACCOUNT_FOLDER_OK;

	hrefs = exchange_hierarchy_somedav_get_hrefs (hsd);
Index: storage/exchange-offline-listener.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/storage/exchange-offline-listener.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 exchange-offline-listener.c
--- storage/exchange-offline-listener.c	26 Feb 2005 14:19:16 -0000	1.6
+++ storage/exchange-offline-listener.c	29 Mar 2005 08:45:03 -0000
@@ -35,6 +35,7 @@ static GObjectClass *parent_class = NULL
struct _ExchangeOfflineListenerPrivate {
	GConfClient *default_client;
+	guint gconf_cnx;
	EDataCalFactory *cal_factory;
	EDataBookFactory *book_factory;
	gboolean offline;
@@ -86,10 +87,10 @@ setup_offline_listener (ExchangeOfflineL
gconf_client_add_dir (priv->default_client, "/apps/evolution/shell", GCONF_CLIENT_PRELOAD_RECURSIVE,NULL);

- gconf_client_notify_add (priv->default_client, + priv->gconf_cnx = gconf_client_notify_add (priv->default_client, "/apps/evolution/shell/start_offline", (GConfClientNotifyFunc)online_status_changed, - ex_offline_listener, NULL, NULL);
+				(gpointer)ex_offline_listener, NULL, NULL);

value = gconf_client_get (priv->default_client, "/apps/evolution/shell/start_offline", NULL);
@@ -134,6 +135,8 @@ static void
exchange_offline_listener_dispose (GObject *object)
{
	ExchangeOfflineListener *ex_offline_listener = EXCHANGE_OFFLINE_LISTENER (object);
+ gconf_client_notify_remove (ex_offline_listener->priv->default_client, + ex_offline_listener->priv->gconf_cnx);
	if (ex_offline_listener->priv->default_client) {
		g_object_unref (ex_offline_listener->priv->default_client);
		ex_offline_listener->priv->default_client = NULL;




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