aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/alarm-notify/alarm.c14
2 files changed, 18 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index e25a1f1778..d6b48f647b 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2001-09-25 Federico Mena Quintero <federico@ximian.com>
+
+ * gui/alarm-notify/alarm.c (alarm_ready_cb): Check that the
+ timeout is not set up before we create a new one; the alarm_fn
+ callback may cause the alarm system to re-enter and add a new
+ alarm. Fixes bug #10840.
+ (pop_alarm): Assert that there is at least one alarm in the queue.
+
2001-09-25 JP Rosevear <jpr@ximian.com>
* pcs/cal.c: use bonobo-exception stuff to clean code
diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c
index 7f45a72712..8ee5146230 100644
--- a/calendar/gui/alarm-notify/alarm.c
+++ b/calendar/gui/alarm-notify/alarm.c
@@ -57,8 +57,7 @@ pop_alarm (void)
AlarmRecord *ar;
GList *l;
- if (!alarms)
- return;
+ g_assert (alarms != NULL);
ar = alarms->data;
@@ -102,8 +101,15 @@ alarm_ready_cb (gpointer data)
(* ar->destroy_notify_fn) (notify_id, ar->data);
}
- if (alarms)
- setup_timeout (now);
+ if (alarms) {
+ /* We need this check because one of the alarm_fn above may have
+ * re-entered and added an alarm of its own, so the timer will
+ * already be set up.
+ */
+ if (timeout_id != 0)
+ setup_timeout (now);
+ } else
+ g_assert (timeout_id == 0);
return FALSE;
}