[evolution-patches] [calendar] fix for #60736



I think the problem is being caused by the idle callback being called
twice, so this probably fixes it.
? mkinstalldirs
? libical/src/libicalss/icalssyacc.output
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.298
diff -u -p -r1.298 ChangeLog
--- ChangeLog	16 Jul 2004 21:10:04 -0000	1.298
+++ ChangeLog	20 Jul 2004 11:38:58 -0000
@@ -1,3 +1,13 @@
+2004-07-20  Rodrigo Moya <rodrigo novell com>
+
+	Probably fixes #60736
+
+	* libecal/e-cal.c (async_auth_idle_cb): remove the idle callback so
+	that it doesn't get called more than once.
+	(async_signal_idle_cb): ditto.
+	(async_auth_func_cb, open_async): store the idle handler id to be
+	able to remove it in the above functions.
+
 2004-07-15  JP Rosevear  <jpr novell com>
 
 	Fixes #58748
Index: libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.68
diff -u -p -r1.68 e-cal.c
--- libecal/e-cal.c	2 Jun 2004 16:15:00 -0000	1.68
+++ libecal/e-cal.c	20 Jul 2004 11:38:59 -0000
@@ -1586,6 +1586,7 @@ typedef struct {
 	char *password;
 	GMutex *mutex;
 	GCond *cond;
+	guint idle_id;
 } ECalAsyncData;
 
 static gboolean
@@ -1593,6 +1594,9 @@ async_auth_idle_cb (gpointer data)
 {
 	ECalAsyncData *ccad = data;
 
+	g_source_remove (ccad->idle_id);
+	ccad->idle_id = -1;
+
 	g_mutex_lock (ccad->mutex);
 	ccad->password = ccad->real_auth_func (ccad->ecal, ccad->auth_prompt, ccad->auth_key, ccad->real_auth_user_data);
 	g_cond_signal (ccad->cond);
@@ -1606,6 +1610,9 @@ async_signal_idle_cb (gpointer data)
 {
 	ECalAsyncData *ccad = data;
 
+	g_source_remove (ccad->idle_id);
+	ccad->idle_id = -1;
+
 	g_signal_emit (G_OBJECT (ccad->ecal), e_cal_signals[CAL_OPENED], 0, ccad->status);
 
 	ccad->ecal->priv->auth_func = ccad->real_auth_func;
@@ -1629,8 +1636,8 @@ async_auth_func_cb (ECal *ecal, const ch
 	ccad->auth_prompt = prompt;
 	ccad->auth_key = key;
 
-	g_idle_add ((GSourceFunc) async_auth_idle_cb, ccad);
-		
+	ccad->idle_id = g_idle_add ((GSourceFunc) async_auth_idle_cb, ccad);
+
 	g_mutex_lock (ccad->mutex);
 	g_cond_wait (ccad->cond, ccad->mutex);
 	password = ccad->password;
@@ -1640,7 +1647,6 @@ async_auth_func_cb (ECal *ecal, const ch
 	return password;
 }
 
-
 static gpointer
 open_async (gpointer data) 
 {
@@ -1655,7 +1661,7 @@ open_async (gpointer data) 
 	ccad->ecal->priv->auth_user_data = ccad;
 
 	ccad->result = open_calendar (ccad->ecal, ccad->exists, NULL, &ccad->status);
-	g_idle_add ((GSourceFunc) async_signal_idle_cb, ccad);
+	ccad->idle_id = g_idle_add ((GSourceFunc) async_signal_idle_cb, ccad);
 
 	return GINT_TO_POINTER (ccad->result);
 }


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