* src/modest-tny-local-folders-account.c:
authorJose Dapena Paz <jdapena@igalia.com>
Fri, 20 Jun 2008 10:09:52 +0000 (10:09 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Fri, 20 Jun 2008 10:09:52 +0000 (10:09 +0000)
        * 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

src/modest-runtime.c
src/modest-tny-local-folders-account.c
src/modest-tny-send-queue.c

index 8eda572..7b1f186 100644 (file)
@@ -89,6 +89,13 @@ modest_runtime_uninit (void)
        
        g_debug ("%s: cleaning up", __FUNCTION__);
 
        
        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;
        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__);
 
        
        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__);
 
        
        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_hash_table_insert (send_queue_cache, 
                                             g_object_ref (account), 
-                                            g_object_ref (send_queue));
+                                            send_queue);
                }
        }
 
                }
        }
 
index 4be9efa..e16597e 100644 (file)
@@ -67,6 +67,13 @@ static TnyFolder*   create_folder  (TnyFolderStore *self,
 static void
 modest_tny_local_folders_account_finalize (GObject *object)
 {
 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);
 }
 
        G_OBJECT_CLASS (modest_tny_local_folders_account_parent_class)->finalize (object);
 }
 
index ba91145..6fe5ce0 100644 (file)
@@ -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_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_unref (priv->outbox);
        g_object_unref (priv->sentbox);
-
-       G_OBJECT_CLASS(parent_class)->finalize (obj);
 }
 
 typedef struct {
 }
 
 typedef struct {