[evolution-data-server] Fix GCancellable usage in IMAPX threads.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Fix GCancellable usage in IMAPX threads.
- Date: Wed, 29 Sep 2010 11:31:58 +0000 (UTC)
commit 3df5e7411088aa83d76dccb4a6eed67665ba4651
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Sep 29 07:31:27 2010 -0400
Fix GCancellable usage in IMAPX threads.
At least I think. Intended behavior is not very clear.
camel/providers/imapx/camel-imapx-server.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 83d1c46..5315c16 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2262,11 +2262,8 @@ static gpointer
imapx_idle_thread (gpointer data)
{
CamelIMAPXServer *is = (CamelIMAPXServer *) data;
- GCancellable *cancellable;
GError *local_error = NULL;
- cancellable = g_object_ref (is->cancellable);
-
while (TRUE) {
CamelIMAPXFolder *ifolder;
@@ -2286,11 +2283,11 @@ imapx_idle_thread (gpointer data)
}
IDLE_UNLOCK (is->idle);
- camel_imapx_server_idle (is, (gpointer)ifolder, cancellable, &local_error);
+ camel_imapx_server_idle (is, (gpointer)ifolder, is->cancellable, &local_error);
if (local_error == NULL && ifolder->exists_on_server >
camel_folder_summary_count (((CamelFolder *) ifolder)->summary) && imapx_is_command_queue_empty (is))
- imapx_server_fetch_new_messages (is, is->select_folder, TRUE, TRUE, cancellable, &local_error);
+ imapx_server_fetch_new_messages (is, is->select_folder, TRUE, TRUE, is->cancellable, &local_error);
if (local_error != NULL) {
e (is->tagprefix, "Caught exception in idle thread: %s \n", local_error->message);
@@ -2307,8 +2304,6 @@ imapx_idle_thread (gpointer data)
break;
}
- g_object_unref (cancellable);
-
g_clear_error (&local_error);
is->idle->idle_thread = NULL;
return NULL;
@@ -4792,7 +4787,10 @@ imapx_parser_thread (gpointer d)
GCancellable *cancellable;
GError *local_error = NULL;
- cancellable = g_object_ref (is->cancellable);
+ QUEUE_LOCK (is);
+ cancellable = g_cancellable_new ();
+ is->cancellable = g_object_ref (cancellable);
+ QUEUE_UNLOCK (is);
while (local_error == NULL && is->stream) {
g_cancellable_reset (cancellable);
@@ -4873,6 +4871,10 @@ imapx_parser_thread (gpointer d)
g_clear_error (&local_error);
QUEUE_LOCK (is);
+ if (is->cancellable != NULL) {
+ g_object_unref (is->cancellable);
+ is->cancellable = NULL;
+ }
g_object_unref (cancellable);
QUEUE_UNLOCK (is);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]