From: Jose Dapena Paz Date: Fri, 20 Jun 2008 10:09:52 +0000 (+0000) Subject: * src/modest-tny-local-folders-account.c: X-Git-Tag: git_migration_finished~1301 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=145d5bece6eb16b437c827ea7b70bcfed236b03f * src/modest-tny-local-folders-account.c: * Release reference to outbox folder when the account is finalized. This was a reference leak. * src/modest-runtime.c: * Release signal handlers before singletons, as they keep references to the send queues. * Also fix a double reference (one leaking) on adding new send queues to cache. * src/modest-tny-send-queue.c: * Finalize parent tny send queue before we unref the sentbox and outbox, as these references are used in parent finalize. pmo-trunk-r4737 --- diff --git a/src/modest-runtime.c b/src/modest-runtime.c index 8eda572..7b1f186 100644 --- a/src/modest-runtime.c +++ b/src/modest-runtime.c @@ -89,6 +89,13 @@ modest_runtime_uninit (void) g_debug ("%s: cleaning up", __FUNCTION__); + if (_sig_handlers) { + modest_signal_mgr_disconnect_all_and_destroy (_sig_handlers); + _sig_handlers = NULL; + } + + g_debug ("%s: cleaned up signal manager", __FUNCTION__); + MODEST_DEBUG_VERIFY_OBJECT_LAST_REF(_singletons,""); g_object_unref(_singletons); _singletons = NULL; @@ -104,11 +111,6 @@ modest_runtime_uninit (void) g_debug ("%s: cleaned up the account store", __FUNCTION__); - if (_sig_handlers) { - modest_signal_mgr_disconnect_all_and_destroy (_sig_handlers); - _sig_handlers = NULL; - } - g_debug ("%s: all cleaned up", __FUNCTION__); @@ -230,7 +232,7 @@ modest_runtime_get_send_queue (TnyTransportAccount *account, g_hash_table_insert (send_queue_cache, g_object_ref (account), - g_object_ref (send_queue)); + send_queue); } } diff --git a/src/modest-tny-local-folders-account.c b/src/modest-tny-local-folders-account.c index 4be9efa..e16597e 100644 --- a/src/modest-tny-local-folders-account.c +++ b/src/modest-tny-local-folders-account.c @@ -67,6 +67,13 @@ static TnyFolder* create_folder (TnyFolderStore *self, static void modest_tny_local_folders_account_finalize (GObject *object) { + ModestTnyLocalFoldersAccountPrivate *priv; + + priv = TNY_LOCAL_FOLDERS_ACCOUNT_GET_PRIVATE (object); + if (priv->outbox_folder) { + g_object_unref (priv->outbox_folder); + priv->outbox_folder = NULL; + } G_OBJECT_CLASS (modest_tny_local_folders_account_parent_class)->finalize (object); } diff --git a/src/modest-tny-send-queue.c b/src/modest-tny-send-queue.c index ba91145..6fe5ce0 100644 --- a/src/modest-tny-send-queue.c +++ b/src/modest-tny-send-queue.c @@ -411,10 +411,9 @@ modest_tny_send_queue_finalize (GObject *obj) g_queue_foreach (priv->queue, (GFunc)modest_tny_send_queue_info_free, NULL); g_queue_free (priv->queue); + G_OBJECT_CLASS(parent_class)->finalize (obj); g_object_unref (priv->outbox); g_object_unref (priv->sentbox); - - G_OBJECT_CLASS(parent_class)->finalize (obj); } typedef struct {