aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-operation.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-operation.c')
-rw-r--r--camel/camel-operation.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index 7c641251b4..adf4c981b1 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -334,7 +334,12 @@ camel_operation_uncancel(CamelOperation *cc)
cc = (CamelOperation *)pthread_getspecific(operation_key);
if (cc) {
+ CamelOperationMsg *msg;
+
LOCK();
+ while ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port)))
+ g_free(msg);
+
cc->flags &= ~CAMEL_OPERATION_CANCELLED;
UNLOCK();
}
@@ -406,7 +411,9 @@ camel_operation_cancel_check (CamelOperation *cc)
cancelled = TRUE;
} else if ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port))) {
d(printf("Got cancellation message\n"));
- g_free(msg);
+ do {
+ g_free(msg);
+ } while ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port)));
cc->flags |= CAMEL_OPERATION_CANCELLED;
cancelled = TRUE;
} else