[evolution-patches] Fix for the bug #64398 [calendar]



Hi,
Have attached a fix for the getdelta crash in calendar. Missed to
attach the patch in previous mail.

thanks, chenthill.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.324
diff -u -p -r1.324 ChangeLog
--- ChangeLog	27 Aug 2004 18:09:58 -0000	1.324
+++ ChangeLog	3 Sep 2004 11:05:26 -0000
@@ -1,3 +1,15 @@
+2004-09-03  Chenthill Palanisamy <pchenthill novell com>
+	
+	Fixes #64398
+	* backends/groupwise/e-cal-backend-groupwise.c
+	(ECalBackendGroupwisePrivate): added an variable to store 
+	the timeout ids.
+	(e_cal_backend_groupwise_init): intialize the variable.
+	(e_cal_backend_groupwise_finalize): remove the timeout_add
+	function so that it will not called when backend dies.
+	(get_deltas): It should not crash in any case if handle is
+	NULL.
+
 2004-08-27  Rodrigo Moya <rodrigo novell com>
 
 	* libedata-cal/e-cal-backend-sexp.c (func_has_alarms_in_range): new
Index: backends/groupwise/e-cal-backend-groupwise.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise.c,v
retrieving revision 1.89
diff -u -p -r1.89 e-cal-backend-groupwise.c
--- backends/groupwise/e-cal-backend-groupwise.c	25 Aug 2004 15:12:12 -0000	1.89
+++ backends/groupwise/e-cal-backend-groupwise.c	3 Sep 2004 11:05:26 -0000
@@ -50,6 +50,7 @@ struct _ECalBackendGroupwisePrivate {
 	char *username;
 	char *password;
 	char *container_id;
+	int timeout_id;
 	CalMode mode;
 	icaltimezone *default_zone;
 	GHashTable *categories_by_id;
@@ -179,6 +180,9 @@ get_deltas (gpointer handle)
         EGwConnectionStatus status; 
 	GSList *deletes = NULL, *updates = NULL, *adds = NULL, *l;
         
+	if (!handle)
+		return FALSE;
+	
 	cbgw = (ECalBackendGroupwise *) handle;
  	cnc = cbgw->priv->cnc; 
  	cache = cbgw->priv->cache; 
@@ -344,7 +348,7 @@ connect_to_server (ECalBackendGroupwise 
 			} else {
 				g_object_ref (priv->cnc);
 				g_object_ref (priv->cache);
-				g_timeout_add (CACHE_REFRESH_INTERVAL, (GSourceFunc) get_deltas, (gpointer) cbgw);
+				priv->timeout_id = g_timeout_add (CACHE_REFRESH_INTERVAL, (GSourceFunc) get_deltas, (gpointer) cbgw);
 				priv->mode = CAL_MODE_REMOTE;
 				/* read the default timezone*/
 				priv->default_zone = e_cal_backend_cache_get_default_timezone (priv->cache);
@@ -432,6 +436,9 @@ e_cal_backend_groupwise_finalize (GObjec
 		priv->user_email = NULL;
 	}
 
+	if (priv->timeout_id) 
+		g_source_remove (priv->timeout_id);
+	
 	g_free (priv);
 	cbgw->priv = NULL;
 
@@ -1506,6 +1513,7 @@ e_cal_backend_groupwise_init (ECalBacken
 
 	priv->categories_by_id = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
 	priv->categories_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+	priv->timeout_id = 0;
 
 	/* create the mutex for thread safety */
 	priv->mutex = g_mutex_new ();


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