[evolution-data-server/gnome-2-26] Bug #583344 - do not leak pipe handles
- From: Milan Crha <mcrha src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution-data-server/gnome-2-26] Bug #583344 - do not leak pipe handles
- Date: Thu, 28 May 2009 10:26:59 -0400 (EDT)
commit b7664ec07988a929387d3ae1cb0135a583979928
Author: Milan Crha <mcrha redhat com>
Date: Thu May 28 16:26:25 2009 +0200
Bug #583344 - do not leak pipe handles
when called disconnect inside connect function call in Camel.
---
camel/camel-service.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 2d6fafb..4546d73 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -341,6 +341,7 @@ camel_service_connect (CamelService *service, CamelException *ex)
{
gboolean ret = FALSE;
gboolean unreg = FALSE;
+ CamelOperation *connect_op;
g_return_val_if_fail (CAMEL_IS_SERVICE (service), FALSE);
g_return_val_if_fail (service->session != NULL, FALSE);
@@ -363,6 +364,7 @@ camel_service_connect (CamelService *service, CamelException *ex)
camel_operation_register (service->connect_op);
unreg = TRUE;
}
+ connect_op = service->connect_op;
CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
service->status = CAMEL_SERVICE_CONNECTING;
@@ -370,11 +372,11 @@ 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 (connect_op) {
+ if (unreg && service->connect_op)
+ camel_operation_unregister (connect_op);
- camel_operation_unref (service->connect_op);
+ camel_operation_unref (connect_op);
service->connect_op = NULL;
}
CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]