aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-sorter-array.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-sorter-array.c')
-rw-r--r--e-util/e-sorter-array.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c
index b36eb06007..106a2d66ca 100644
--- a/e-util/e-sorter-array.c
+++ b/e-util/e-sorter-array.c
@@ -248,6 +248,18 @@ e_sorter_array_append (ESorterArray *esa,
}
}
+static void
+esa_finalize (GObject *object)
+{
+ ESorterArray *esa = E_SORTER_ARRAY (object);
+
+ if (esa)
+ e_sorter_array_clean (esa);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_sorter_array_parent_class)->finalize (object);
+}
+
ESorterArray *
e_sorter_array_construct (ESorterArray *esa,
ECreateCmpCacheFunc create_cmp_cache,
@@ -273,8 +285,11 @@ e_sorter_array_new (ECreateCmpCacheFunc create_cmp_cache,
static void
e_sorter_array_class_init (ESorterArrayClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
ESorterClass *sorter_class = E_SORTER_CLASS (klass);
+ object_class->finalize = esa_finalize;
+
sorter_class->model_to_sorted = esa_model_to_sorted;
sorter_class->sorted_to_model = esa_sorted_to_model;
sorter_class->get_model_to_sorted_array = esa_get_model_to_sorted_array;