Issue when moving folders



Hi,

I'm getting a SIGSEV when moving folders between accounts and I think that that's a tinymail issue.

I'm calling tny_camel_folder_copy_async which internally calls tny_camel_folder_copy_shared. This last one calls recurse_copy which removes the source folder (tny_camel_folder.c:1729) if the user wants to move the original folder. The problem is that tny_camel_folder_copy_shared whill try to remove again the original folder (tny_camel_folder.c:2023). So we'll get a SIGSEV, because the original folder was already removed.

I saw no reason to have this second removal, so what I propose is to remove that code. The new patched code was successfully tested and checked with valgrind.

Comments? Opinions?

Br
Index: tny-camel-folder.c
===================================================================
--- tny-camel-folder.c	(revision 2269)
+++ tny-camel-folder.c	(working copy)
@@ -2011,6 +2011,7 @@
 			g_error_free (nerr);
 		nerr = NULL;
 
+		/* The recurse_copy call deletes the original folder if del==TRUE */
 		cpyr = recurse_copy (self, into, new_name, del, &nerr, adds, rems);
 
 		if (nerr != NULL) {
@@ -2018,16 +2019,6 @@
 				g_propagate_error (err, nerr);
 			else
 				g_error_free (nerr);
-		} else if (del) {
-			TnyFolderStore *from = tny_folder_get_folder_store (self);
-			tny_folder_store_remove_folder (from, self, &nerr);
-			g_object_unref (from);
-			if (nerr != NULL ) {
-				if (!tried)
-					g_propagate_error (err, nerr);
-				else
-					g_error_free (nerr);
-			}
 		}
 
 		retval = cpyr->created;


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