diff options
-rw-r--r-- | calendar/ChangeLog | 11 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/alarm-queue.c | 12 |
2 files changed, 19 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index d4f3d1723a..ae5e563440 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,14 @@ +2003-04-17 Rodrigo Moya <rodrigo@ximian.com> + + Fixes #34498 + + * gui/alarm-notify/alarm-queue.c: added a 'uid' field to the + CompQueuedAlarms structure. + (remove_queued_alarm): free the 'uid' field when freeing the + structure. + (add_component_alarms): g_strdup the component's UID and use that as + the key for the hash table. + 2003-04-16 Rodrigo Moya <rodrigo@ximian.com> Fixes #41129, #41215, #41221, #41256 diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index f117e53723..fa04a63daa 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -82,6 +82,9 @@ typedef struct { /* The parent client alarms structure */ ClientAlarms *parent_client; + /* The component's UID */ + char *uid; + /* The actual component and its alarm instances */ CalComponentAlarms *alarms; @@ -200,7 +203,6 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id, gboolean free_object, gboolean remove_alarm) { QueuedAlarm *qa; - const char *uid; GSList *l; qa = NULL; @@ -236,8 +238,9 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id, return; if (free_object) { - cal_component_get_uid (cqa->alarms->comp, &uid); - g_hash_table_remove (cqa->parent_client->uid_alarms_hash, uid); + g_hash_table_remove (cqa->parent_client->uid_alarms_hash, cqa->uid); + g_free (cqa->uid); + cqa->uid = NULL; cqa->parent_client = NULL; cal_component_alarms_free (cqa->alarms); g_free (cqa); @@ -362,7 +365,8 @@ add_component_alarms (ClientAlarms *ca, CalComponentAlarms *alarms) } cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms); - g_hash_table_insert (ca->uid_alarms_hash, (char *) uid, cqa); + cqa->uid = g_strdup (uid); + g_hash_table_insert (ca->uid_alarms_hash, cqa->uid, cqa); } /* Loads the alarms of a client for a given range of time */ |