From 4c0938e5cbdc7215f3b04f93e42c4acc1004d8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Mon, 20 Oct 2014 15:00:59 -0400 Subject: [PATCH] manager: free clients' hash-table with g_free Since ECalDataModel keeps a ref to the connected EClients there's no need of keeping another and using a custom free function for clients' hash --- src/gcal-manager.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/gcal-manager.c b/src/gcal-manager.c index 40751774..f280d41c 100644 --- a/src/gcal-manager.c +++ b/src/gcal-manager.c @@ -90,8 +90,6 @@ enum static guint signals[LAST_SIGNAL]; -void free_manager_unit_data (gpointer data); - static void load_source (GcalManager *manager, ESource *source); @@ -201,18 +199,6 @@ submit_thread_job (EThreadJobFunc func, } /* -- end: threading related code provided by Milan Crha -- */ -void -free_manager_unit_data (gpointer data) -{ - GcalManagerUnit *unit; - - unit = (GcalManagerUnit*) data; - - g_clear_object (&(unit->client)); - - g_free (unit); -} - /** * load_source: * @manager: Manager instance @@ -468,6 +454,9 @@ gcal_manager_finalize (GObject *object) if (priv->final_date != NULL) g_free (priv->final_date); + if (priv->e_data_model != NULL) + g_object_unref (priv->e_data_model); + g_hash_table_destroy (priv->clients); }