[evolution-patches] (yet) another patch for alarm daemon in 1.4.x



When everything seemed to be fully working, I had a stale evolution-
wombat process lying around. With the attached patch, I haven't been
able to reproduce it since then, so in case it's needed for 1.4.6, here
it is.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1802.2.43
diff -u -p -r1.1802.2.43 ChangeLog
--- ChangeLog	18 Feb 2004 17:40:27 -0000	1.1802.2.43
+++ ChangeLog	18 Feb 2004 23:10:50 -0000
@@ -1,3 +1,10 @@
+2004-02-18  Rodrigo Moya <rodrigo ximian com>
+
+	* gui/alarm-notify/alarm-notify.c: no need to keep reference counts.
+	(destroy_loaded_client_cb): remove the client from the queue also.
+
+	* gui/alarm-notify/alarm-queue.c: no need to keep reference counts.
+
 2004-02-17  Rodrigo Moya <rodrigo ximian com>
 
 	* gui/alarm-notify/notify-main.c: (init_session): just set the
Index: gui/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/Makefile.am,v
retrieving revision 1.268.4.1
diff -u -p -r1.268.4.1 Makefile.am
--- gui/Makefile.am	8 Sep 2003 15:00:35 -0000	1.268.4.1
+++ gui/Makefile.am	18 Feb 2004 23:10:50 -0000
@@ -199,12 +199,7 @@ BUILT_SOURCES = $(IDL_GENERATED) $(serve
 CLEANFILES = $(BUILT_SOURCES)
 
 install-data-local:
-	$(mkinstalldirs) $(Conduitsdir); \
-	if test -z "$(DESTDIR)"; then \
-		for p in $(schema_DATA); do \
-			GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p; \
-		done; \
-	fi
+	$(mkinstalldirs) $(Conduitsdir)
 
 dist-hook:
 	cd $(distdir); rm -f $(BUILT_SOURCES)
Index: gui/alarm-notify/alarm-notify.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-notify.c,v
retrieving revision 1.20.4.2
diff -u -p -r1.20.4.2 alarm-notify.c
--- gui/alarm-notify/alarm-notify.c	24 Jan 2004 23:50:41 -0000	1.20.4.2
+++ gui/alarm-notify/alarm-notify.c	18 Feb 2004 23:10:51 -0000
@@ -41,11 +41,6 @@ typedef struct {
 	 */
 	EUri *uri;
 
-	/* Number of times clients have requested this URI to be added to the
-	 * alarm notification system.
-	 */
-	int refcount;
-
 	/* the ID of the retry timeout function
 	 */
 	int timeout_id;
@@ -118,6 +113,8 @@ destroy_loaded_client_cb (gpointer key, 
 	str_uri = key;
 	lc = value;
 	
+	alarm_queue_remove_client (lc->client);
+
 	g_free (str_uri);
 	g_object_unref (G_OBJECT (lc->client));
 	e_uri_free (lc->uri);
@@ -328,12 +325,6 @@ AlarmNotify_removeCalendar (PortableServ
 		return;
 	}
 
-	g_assert (lc->refcount > 0);
-
-	lc->refcount--;
-	if (lc->refcount > 0)
-		return;
-
 	g_hash_table_remove (priv->uri_client_hash, str_uri);
 
 	g_free (orig_str);
@@ -440,7 +431,6 @@ alarm_notify_add_calendar (AlarmNotify *
 
 	if (g_hash_table_lookup_extended (priv->uri_client_hash, str_uri, &s_ptr, &lc_ptr)) {
 		lc = lc_ptr;
-		lc->refcount++;
 
 		e_uri_free (uri);
 	} else {
@@ -458,7 +448,6 @@ alarm_notify_add_calendar (AlarmNotify *
 			if (cal_client_open_calendar (client, str_uri, FALSE)) {
 				lc->client = client;
 				lc->uri = uri;
-				lc->refcount = 1;
 				lc->timeout_id = -1;
 				g_hash_table_insert (priv->uri_client_hash,
 						     g_strdup (str_uri), lc);
Index: gui/alarm-notify/alarm-queue.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-queue.c,v
retrieving revision 1.40.4.1
diff -u -p -r1.40.4.1 alarm-queue.c
--- gui/alarm-notify/alarm-queue.c	24 Jan 2004 23:50:41 -0000	1.40.4.1
+++ gui/alarm-notify/alarm-queue.c	18 Feb 2004 23:10:52 -0000
@@ -63,9 +63,6 @@ typedef struct {
 	/* Monitored client */
 	CalClient *client;
 
-	/* Number of times this client has been registered */
-	int refcount;
-
 	/* Hash table of component UID -> CompQueuedAlarms.  If an element is
 	 * present here, then it means its cqa->queued_alarms contains at least
 	 * one queued alarm.  When all the alarms for a component have been
@@ -660,7 +657,6 @@ struct notify_dialog_closure {
 static void
 on_dialog_obj_updated_cb (CalClient *client, const char *uid, gpointer data)
 {
-	struct notify_dialog_closure *c = data;
 }
 
 static void
@@ -1099,17 +1095,14 @@ alarm_queue_add_client (CalClient *clien
 	g_return_if_fail (IS_CAL_CLIENT (client));
 
 	ca = lookup_client (client);
-	if (ca) {
-		ca->refcount++;
+	if (ca)
 		return;
-	}
 
 	ca = g_new (ClientAlarms, 1);
 
 	ca->client = client;
 	g_object_ref (ca->client);
 
-	ca->refcount = 1;
 	g_hash_table_insert (client_alarms_hash, client, ca);
 
 	ca->uid_alarms_hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1150,12 +1143,6 @@ alarm_queue_remove_client (CalClient *cl
 	ca = lookup_client (client);
 	g_return_if_fail (ca != NULL);
 
-	g_assert (ca->refcount > 0);
-	ca->refcount--;
-
-	if (ca->refcount > 0)
-		return;
-
 	remove_client_alarms (ca);
 
 	/* Clean up */


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