aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-09-26 04:25:03 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-09-26 04:25:03 +0800
commit8b7c7e807f58b351e76a6a0733758875363ad37b (patch)
tree4a012ed4423c579d73340e50e149bca217837808 /calendar/gui
parent70a6a65a5607ab0003c25bd64a4338baa47d1dd5 (diff)
downloadgsoc2013-evolution-8b7c7e807f58b351e76a6a0733758875363ad37b.tar
gsoc2013-evolution-8b7c7e807f58b351e76a6a0733758875363ad37b.tar.gz
gsoc2013-evolution-8b7c7e807f58b351e76a6a0733758875363ad37b.tar.bz2
gsoc2013-evolution-8b7c7e807f58b351e76a6a0733758875363ad37b.tar.lz
gsoc2013-evolution-8b7c7e807f58b351e76a6a0733758875363ad37b.tar.xz
gsoc2013-evolution-8b7c7e807f58b351e76a6a0733758875363ad37b.tar.zst
gsoc2013-evolution-8b7c7e807f58b351e76a6a0733758875363ad37b.zip
Check that the timeout is not set up before we create a new one; the
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. svn path=/trunk/; revision=13117
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/alarm-notify/alarm.c14
1 files changed, 10 insertions, 4 deletions
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;
}