Re: Patch: add a reason to tny_camel_folder_get_headers_async operation



El vie, 09-05-2008 a las 12:02 +0200, José Dapena Paz escribió:
> 	Hi,
> 
> 	This patch adds some reasons to get_headers_async operation, as it
> could happen that, while the operation was running for renewing the gtk
> list store model headers, we got 0 reasons (all old headers removed but
> no new header added). Then we were freeing the message cache.

	And now the patch ;)

> 
> 	This caused some not so infrequent crashes.
> 
> 	The changelog entry is this one:
> 
> * libtinymail-camel/tny-camel-folder.c:
>         * Add some reasons/unreasons in get_headers_operation, to avoid
>           getting a 0 account when we are replacing the headers in the
>           gtk list store model. This should avoid some very hidden
>           crashes.
> 
-- 
José Dapena Paz <jdapena igalia com>
Igalia
Index: libtinymail-camel/tny-camel-folder.c
===================================================================
--- libtinymail-camel/tny-camel-folder.c	(revision 3648)
+++ libtinymail-camel/tny-camel-folder.c	(working copy)
@@ -26,6 +26,7 @@
 #endif
 
 #include <string.h>
+#define DEBUG_EXTRA
 
 
 #include <tny-status.h>
@@ -1555,8 +1556,10 @@
 		}
 
 	camel_folder_sync (priv->folder, expunge, &ex);
+	_tny_camel_folder_reason (priv);
 	_tny_camel_folder_check_unread_count (TNY_CAMEL_FOLDER (self));
 	reset_local_size (priv);
+	_tny_camel_folder_unreason (priv);
 
 	g_static_rec_mutex_unlock (priv->folder_lock);
 
@@ -2160,6 +2163,7 @@
 	/* thread reference */
 	g_object_unref (info->self);
 	g_object_unref (info->headers);
+	_tny_camel_folder_unreason (priv);
 
 	if (info->err)
 		g_error_free (info->err);
@@ -2208,6 +2212,7 @@
 		g_error_free (info->err);
 	g_object_unref (info->self);
 	g_object_unref (info->headers);
+	_tny_camel_folder_unreason (priv);
 
 	/**/
 
@@ -2257,6 +2262,7 @@
 	g_object_ref (info->self);
 	g_object_ref (info->headers);
 
+	_tny_camel_folder_reason (priv);
 	_tny_camel_queue_cancel_remove_items (TNY_FOLDER_PRIV_GET_QUEUE (priv), 
 		TNY_CAMEL_QUEUE_GET_HEADERS_ITEM|TNY_CAMEL_QUEUE_SYNC_ITEM|
 		TNY_CAMEL_QUEUE_REFRESH_ITEM);


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