Patch for tny_camel_folder_finalize



Hi,

in case a folder stores the last reference to a TnyAccount then that
folder won't be removed from the managed_folders list. Take a look at
the proposed patch that moves the removal of the folder up the account
unref.

Br
Index: libtinymail-camel/tny-camel-folder.c
===================================================================
--- libtinymail-camel/tny-camel-folder.c	(revision 3736)
+++ libtinymail-camel/tny-camel-folder.c	(working copy)
@@ -6063,6 +6063,13 @@
 	if (priv->store)
 		camel_object_unref (priv->store);
 
+	if (priv->account && TNY_IS_CAMEL_STORE_ACCOUNT (priv->account)) {
+		TnyCamelStoreAccountPriv *apriv = TNY_CAMEL_STORE_ACCOUNT_GET_PRIVATE (priv->account);
+		g_static_rec_mutex_lock (apriv->factory_lock);
+		apriv->managed_folders = g_list_remove (apriv->managed_folders, self);
+		g_static_rec_mutex_unlock (apriv->factory_lock);
+	}
+
 #ifdef ACCOUNT_WEAK_REF
 	if (priv->account)
 		g_object_weak_unref (G_OBJECT (priv->account), notify_account_del, self);
@@ -6079,13 +6086,6 @@
 	g_static_rec_mutex_lock (priv->folder_lock);
 	priv->dont_fkill = FALSE;
 
-	if (priv->account && TNY_IS_CAMEL_STORE_ACCOUNT (priv->account)) {
-		TnyCamelStoreAccountPriv *apriv = TNY_CAMEL_STORE_ACCOUNT_GET_PRIVATE (priv->account);
-		g_static_rec_mutex_lock (apriv->factory_lock);
-		apriv->managed_folders = g_list_remove (apriv->managed_folders, self);
-		g_static_rec_mutex_unlock (apriv->factory_lock);
-	}
-
 	if (!priv->iter_parented && priv->iter) {
 		CamelStore *store = priv->store;
 		camel_store_free_folder_info (store, priv->iter);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]