aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2007-08-06 14:28:48 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-08-06 14:28:48 +0800
commit634ee40f05b1edfc841761f2f1f73be5625c86f6 (patch)
tree69a82d3949a8b6a4d61452f96fba9a5969391c00 /calendar
parent771c2a1f0266331a9b9250ee391fca88dd545b66 (diff)
downloadgsoc2013-evolution-634ee40f05b1edfc841761f2f1f73be5625c86f6.tar
gsoc2013-evolution-634ee40f05b1edfc841761f2f1f73be5625c86f6.tar.gz
gsoc2013-evolution-634ee40f05b1edfc841761f2f1f73be5625c86f6.tar.bz2
gsoc2013-evolution-634ee40f05b1edfc841761f2f1f73be5625c86f6.tar.lz
gsoc2013-evolution-634ee40f05b1edfc841761f2f1f73be5625c86f6.tar.xz
gsoc2013-evolution-634ee40f05b1edfc841761f2f1f73be5625c86f6.tar.zst
gsoc2013-evolution-634ee40f05b1edfc841761f2f1f73be5625c86f6.zip
** Fix for bug #454253
svn path=/trunk/; revision=33952
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/alarm-notify/alarm.c27
2 files changed, 29 insertions, 6 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 573dcb979d..d394011bd4 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-06 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #454253
+
+ * gui/alarm-notify/alarm.c: (pop_alarm), (alarm_ready_cb),
+ (setup_timeout), (alarm_done): Fail safe instead of crash, when it is
+ not really required to crash.
+
2007-08-03 Hiroyuki Ikezoe <poincare@ikezoe.net>
** Fix for bug #377173
diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c
index b360075d13..13dca9ca77 100644
--- a/calendar/gui/alarm-notify/alarm.c
+++ b/calendar/gui/alarm-notify/alarm.c
@@ -56,7 +56,10 @@ pop_alarm (void)
AlarmRecord *ar;
GList *l;
- g_assert (alarms != NULL);
+ if (!alarms) {
+ g_warning ("Nothing to pop from the alarm queue");
+ return;
+ }
ar = alarms->data;
@@ -72,7 +75,11 @@ alarm_ready_cb (gpointer data)
{
time_t now;
- g_assert (alarms != NULL);
+ if (!alarms) {
+ g_warning ("Alarm triggered, but no alarm present\n");
+ return FALSE;
+ }
+
timeout_id = 0;
now = time (NULL);
@@ -120,7 +127,11 @@ setup_timeout (void)
const AlarmRecord *ar;
guint diff;
time_t now;
- g_assert (alarms != NULL);
+
+ if (!alarms) {
+ g_warning ("No alarm to setup\n");
+ return;
+ }
ar = alarms->data;
@@ -273,15 +284,19 @@ alarm_done (void)
GList *l;
if (timeout_id == 0) {
- g_assert (alarms == NULL);
+ if (alarms)
+ g_warning ("No timeout, but queue is not NULL\n");
return;
}
- g_assert (alarms != NULL);
-
g_source_remove (timeout_id);
timeout_id = 0;
+ if (!alarms) {
+ g_warning ("timeout present, freed, but no alarms active\n");
+ return;
+ }
+
for (l = alarms; l; l = l->next) {
AlarmRecord *ar;