aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2003-05-20 20:00:38 +0800
committerDan Winship <danw@src.gnome.org>2003-05-20 20:00:38 +0800
commit29c2c9098e10451d6339748dbfc58c5b5fb68d28 (patch)
tree893ac2b59cd8be0a19c5be26816308a00d3e3176 /calendar
parent2913c7ef314431dbb93135e80d9fc228fe83f9de (diff)
downloadgsoc2013-evolution-29c2c9098e10451d6339748dbfc58c5b5fb68d28.tar
gsoc2013-evolution-29c2c9098e10451d6339748dbfc58c5b5fb68d28.tar.gz
gsoc2013-evolution-29c2c9098e10451d6339748dbfc58c5b5fb68d28.tar.bz2
gsoc2013-evolution-29c2c9098e10451d6339748dbfc58c5b5fb68d28.tar.lz
gsoc2013-evolution-29c2c9098e10451d6339748dbfc58c5b5fb68d28.tar.xz
gsoc2013-evolution-29c2c9098e10451d6339748dbfc58c5b5fb68d28.tar.zst
gsoc2013-evolution-29c2c9098e10451d6339748dbfc58c5b5fb68d28.zip
Don't double-free newly-added categories that the gui hasn't been told
* pcs/cal-backend.c (cal_backend_finalize): Don't double-free newly-added categories that the gui hasn't been told about yet. #43321 svn path=/trunk/; revision=21275
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/pcs/cal-backend.c28
2 files changed, 19 insertions, 15 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index f51b603f04..762f2693b9 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2003-05-19 Dan Winship <danw@ximian.com>
+
+ * pcs/cal-backend.c (cal_backend_finalize): Don't double-free
+ newly-added categories that the gui hasn't been told about yet.
+ #43321
+
2003-05-19 Rodrigo Moya <rodrigo@ximian.com>
* gui/main.c (factory): set 'initialized' to TRUE when initialization
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c
index bf974ddc70..f493302136 100644
--- a/calendar/pcs/cal-backend.c
+++ b/calendar/pcs/cal-backend.c
@@ -222,6 +222,16 @@ free_category_cb (gpointer key, gpointer value, gpointer data)
g_free (c);
}
+static gboolean
+prune_changed_categories (gpointer key, gpointer value, gpointer data)
+{
+ CalBackendCategory *c = value;
+
+ if (!c->refcount)
+ free_category_cb (key, value, data);
+ return TRUE;
+}
+
void
cal_backend_finalize (GObject *object)
{
@@ -232,12 +242,12 @@ cal_backend_finalize (GObject *object)
g_assert (priv->clients == NULL);
+ g_hash_table_foreach_remove (priv->changed_categories, prune_changed_categories, NULL);
+ g_hash_table_destroy (priv->changed_categories);
+
g_hash_table_foreach (priv->categories, free_category_cb, NULL);
g_hash_table_destroy (priv->categories);
- g_hash_table_foreach (priv->changed_categories, free_category_cb, NULL);
- g_hash_table_destroy (priv->changed_categories);
-
if (priv->category_idle_id)
g_source_remove (priv->category_idle_id);
@@ -1153,18 +1163,6 @@ notify_categories_changed (CalBackend *backend)
}
static gboolean
-prune_changed_categories (gpointer key, gpointer value, gpointer data)
-{
- CalBackendCategory *category = value;
-
- if (!category->refcount) {
- g_free (category->name);
- g_free (category);
- }
- return TRUE;
-}
-
-static gboolean
idle_notify_categories_changed (gpointer data)
{
CalBackend *backend = CAL_BACKEND (data);