From ef8832bb8035edaad77749413afc110e9b8ea01e Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 4 Jan 2012 14:53:21 +0100 Subject: Bug #665036 - Memory leaks spot in Contacts view --- e-util/e-sorter-array.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'e-util') 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; -- cgit v1.2.3