[evolution-patches] patch of bug 51187 on bugzilla
- From: Alfred Peng <alfred peng sun com>
- To: evolution-patches ximian com
- Subject: [evolution-patches] patch of bug 51187 on bugzilla
- Date: Wed, 10 Mar 2004 18:27:03 +0800
Dear rodrigo,
I have a patch of bug 51187 on bugzilla.
My evolution version is uptodate, and cvs download from trunk on
2004-3-9.
You can reproduce the problem following the steps:
1.Create a appointment in the calender today.
2.setup up a alarm for this appointment.
3.Drag and Drop this appointment to another day, before or after.
result:
evolution-alarm-notify crash
Stepping into the source code, I found that the main problem is in
the file calendar/gui/alarm-notify/alarm-queue.c, function
"query_objects_changed_cb".
When returning from the function "e_cal_get_alarms_for_object", the
variable "alarms" or "alarms->alarms"maybe NULL. And then, if we've
added the component to the hash table before, we can get the
corresponding "cqa" to the variable "uid". The
program evolution-alarm-notify will be in trouble.
In some conditions, the "alarms" is NULL, and trouble happened at
the code "(sl = cqa->alarms->alarms; sl; sl = sl->next)"; In some other
conditions, the "alarms->alarms" is NULL, and evolution-alarm-notify
will crash in the function "remove_comp", the code "g_assert
(cqa->queued_alarms != NULL)" will failed.
So my opinion is to check the "alarms" and the "alarms->alarms"
before proceeding, just as the patch shows. If one of the two variables
is NULL, just remove the alarms. Otherwise, update it in the following
steps.
By the way, I don't understand the usage of the member variable
"expecting_update" clearly.
I'm looking for your answering.
Thanks a lot.
Regards
Alfred Peng
? evolution/calendar/gui/alarm-notify/.alarm-queue.c.swp
Index: evolution/calendar/gui/alarm-notify/alarm-queue.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-queue.c,v
retrieving revision 1.59
diff -u -r1.59 alarm-queue.c
--- evolution/calendar/gui/alarm-notify/alarm-queue.c 4 Mar 2004 11:38:58 -0000 1.59
+++ evolution/calendar/gui/alarm-notify/alarm-queue.c 10 Mar 2004 10:20:51 -0000
@@ -541,6 +541,13 @@
return;
}
+ /* if the alarms or the alarms list is empty, just remove it */
+ if (alarms == NULL || alarms->alarms == NULL) {
+ if (alarms)
+ e_cal_component_alarms_free (alarms);
+ continue;
+ }
+
cqa = lookup_comp_queued_alarms (ca, uid);
if (!cqa)
add_component_alarms (ca, alarms);
@@ -575,11 +582,7 @@
cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa);
}
- if (cqa->queued_alarms == NULL) {
- if (!cqa->expecting_update)
- remove_comp (ca, uid);
- } else
- cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms);
+ cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]