diff options
author | Federico Mena Quintero <federico@ximian.com> | 2001-09-26 04:25:03 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2001-09-26 04:25:03 +0800 |
commit | 8b7c7e807f58b351e76a6a0733758875363ad37b (patch) | |
tree | 4a012ed4423c579d73340e50e149bca217837808 /calendar | |
parent | 70a6a65a5607ab0003c25bd64a4338baa47d1dd5 (diff) | |
download | gsoc2013-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')
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/alarm.c | 14 |
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; } |