[evolution-ews] Jobs can be started with already cancelled GCancellable
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Jobs can be started with already cancelled GCancellable
- Date: Tue, 28 Aug 2012 14:02:44 +0000 (UTC)
commit 9c2a417f8b6a894d86d4843eadded941a77e3e42
Author: Milan Crha <mcrha redhat com>
Date: Tue Aug 28 16:01:40 2012 +0200
Jobs can be started with already cancelled GCancellable
src/server/e-ews-connection.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index b239e61..b0d896b 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -450,7 +450,7 @@ ews_active_job_done (EEwsConnection *cnc,
QUEUE_LOCK (cnc);
cnc->priv->active_job_queue = g_slist_remove (cnc->priv->active_job_queue, ews_node);
- if (ews_node->cancellable)
+ if (ews_node->cancellable && ews_node->cancel_handler_id)
g_signal_handler_disconnect (ews_node->cancellable, ews_node->cancel_handler_id);
QUEUE_UNLOCK (cnc);
@@ -524,10 +524,13 @@ e_ews_connection_queue_request (EEwsConnection *cnc,
if (cancellable) {
node->cancellable = g_object_ref (cancellable);
- node->cancel_handler_id = g_cancellable_connect (
- cancellable,
- G_CALLBACK (ews_cancel_request),
- (gpointer) node, NULL);
+ if (g_cancellable_is_cancelled (cancellable))
+ ews_cancel_request (cancellable, node);
+ else
+ node->cancel_handler_id = g_cancellable_connect (
+ cancellable,
+ G_CALLBACK (ews_cancel_request),
+ (gpointer) node, NULL);
}
ews_trigger_next_request (cnc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]