Patch: reason destination folder on copy shared operation.



	Hi,

	This patch adds proper reason/unreason on destination folder, to avoid
some crashes that could happen if the destination folder CamelFolder
reference is replaced in the middle of a move to operation.

Changelog entry:
	* libtinymail-camel/tny-camel-folder.c: reason/unreason the
	destination folder on copy_async, to avoid freeing the summary
	and then crashing on subsequent access.


-- 
José Dapena Paz <jdapena igalia com>
Igalia
diff --git a/ChangeLog b/ChangeLog
index c27bb0d..20eb18f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-19  Jose Dapena Paz  <jdapena igalia com>
+
+	* libtinymail-camel/tny-camel-folder.c: reason/unreason the
+	destination folder on copy_async, to avoid freeing the summary
+	and then crashing on subsequent access.
+
 2009-05-18  Sergio Villar Senin  <svillar igalia com>
 
 	* libtinymail-camel/tny-camel-send-queue.c
diff --git a/libtinymail-camel/tny-camel-folder.c b/libtinymail-camel/tny-camel-folder.c
index f13b2ee..6e8d486 100644
--- a/libtinymail-camel/tny-camel-folder.c
+++ b/libtinymail-camel/tny-camel-folder.c
@@ -3945,6 +3945,7 @@ static void
 tny_camel_folder_copy_async_default (TnyFolder *self, TnyFolderStore *into, const gchar *new_name, gboolean del, TnyCopyFolderCallback callback, TnyStatusCallback status_callback, gpointer user_data)
 {
 	TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self);
+	TnyCamelFolderPriv *dest_priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self);
 	CopyFolderInfo *info;
 
 	/* Idle info for the callbacks */
@@ -4624,8 +4625,11 @@ tny_camel_folder_transfer_msgs_shared (TnyFolder *self, TnyList *headers, TnyFol
 			on_err = TRUE;
 		}
 
-	if (!on_err)
+	if (!on_err) {
+		_tny_camel_folder_reason (priv_dst);
 		transfer_msgs_thread_clean (self, headers, new_headers, folder_dst, delete_originals, err);
+		_tny_camel_folder_unreason (priv_dst);
+	}
 
 	return;
 }


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