aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-service.c')
-rw-r--r--camel/camel-service.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 9c32256fe0..a166fcc554 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -260,12 +260,12 @@ camel_service_connect (CamelService *service, CamelException *ex)
service->status = ret ? CAMEL_SERVICE_CONNECTED : CAMEL_SERVICE_DISCONNECTED;
CAMEL_SERVICE_LOCK (service, connect_op_lock);
- if (service->connect_op) {
- if (unreg)
- camel_operation_unregister (service->connect_op);
-
+ if (unreg) {
+ camel_operation_unregister (service->connect_op);
camel_operation_unref (service->connect_op);
service->connect_op = NULL;
+ } else {
+ camel_operation_unref (service->connect_op);
}
CAMEL_SERVICE_UNLOCK (service, connect_op_lock);