aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorJP Rosevear <jpr@src.gnome.org>2004-06-04 02:02:56 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-06-04 02:02:56 +0800
commit3048b4c9decd91d7c5baa0a9ec29f98a91976f1a (patch)
treeba6f25a662319846fd160fdb8d2211cc058f11af /calendar
parentdae1aa0ac0d5aa9e220f9de63b30f65ee0961665 (diff)
downloadgsoc2013-evolution-3048b4c9decd91d7c5baa0a9ec29f98a91976f1a.tar.gz
gsoc2013-evolution-3048b4c9decd91d7c5baa0a9ec29f98a91976f1a.tar.zst
gsoc2013-evolution-3048b4c9decd91d7c5baa0a9ec29f98a91976f1a.zip
Merge from release branch.
svn path=/trunk/; revision=26178
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c17
2 files changed, 20 insertions, 5 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index abf48025b2..cf2cc952df 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -23,6 +23,13 @@
"client_changed signal on the TaskPage.
(client_changed_cb): set menu sensibility when the client changes.
+2004-06-02 JP Rosevear <jpr@novell.com>
+
+ * gui/alarm-notify/alarm-notify.c (process_removal_in_hash): free
+ the correct uri, preventing bad memory corruption
+ (list_changed_cb): track the removals in a list so we don't
+ clobber the hash table data during the foreach loop
+
2004-06-02 Chris Toshok <toshok@ximian.com>
* gui/migration.c (migrate_calendars): remove absolute_uri from
@@ -63,6 +70,7 @@
* gui/dialogs/calendar-setup.glade: remove edit dialogs and name
the tables.
+
2004-06-01 Rodrigo Moya <rodrigo@novell.com>
Fixes #59369
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index 0c3231aaae..19e5daf15f 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -72,6 +72,7 @@ alarm_notify_class_init (AlarmNotifyClass *klass)
typedef struct {
AlarmNotify *an;
ESourceList *source_list;
+ GList *removals;
} ProcessRemovalsData;
static void
@@ -95,16 +96,15 @@ process_removal_in_hash (gpointer key, gpointer value, gpointer data)
source_uri = e_source_get_uri (source);
if (strcmp (source_uri, uri) == 0)
found = TRUE;
- g_free (uri);
+ g_free (source_uri);
if (found)
return;
}
}
- /* not found, so remove it */
- g_message ("Removing %s", uri);
- alarm_notify_remove_calendar (prd->an, uri);
+ /* not found, so list it for removal */
+ prd->removals = g_list_prepend (prd->removals, uri);
}
static void
@@ -115,6 +115,7 @@ list_changed_cb (ESourceList *source_list, gpointer data)
GSList *groups, *sources, *p, *q;
ECalSourceType source_type = E_CAL_SOURCE_TYPE_LAST;
ProcessRemovalsData prd;
+ GList *l;
int i;
priv = an->priv;
@@ -151,10 +152,16 @@ list_changed_cb (ESourceList *source_list, gpointer data)
/* process the removals */
prd.an = an;
prd.source_list = priv->source_lists[source_type];
+ prd.removals = NULL;
g_hash_table_foreach (priv->uri_client_hash, (GHFunc) process_removal_in_hash, &prd);
+
+ for (l = prd.removals; l; l = l->next) {
+ g_message ("Removing %s", (char *)l->data);
+ alarm_notify_remove_calendar (an, l->data);
+ }
+ g_list_free (prd.removals);
}
-/* Loads the calendars that the alarm daemon has been told to load in the past */
static void
load_calendars (AlarmNotify *an, ECalSourceType source_type)
{