aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-service.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-12-14 04:38:11 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-12-14 04:38:11 +0800
commit66587d89a30adfd7251dfd586e6213f9e9c536a0 (patch)
treef67f41fe3a63c1e1ceda889068eb7bc4c506381f /camel/camel-service.c
parente2f8314f13c805cc9991f604f8609723ed1ec372 (diff)
downloadgsoc2013-evolution-66587d89a30adfd7251dfd586e6213f9e9c536a0.tar
gsoc2013-evolution-66587d89a30adfd7251dfd586e6213f9e9c536a0.tar.gz
gsoc2013-evolution-66587d89a30adfd7251dfd586e6213f9e9c536a0.tar.bz2
gsoc2013-evolution-66587d89a30adfd7251dfd586e6213f9e9c536a0.tar.lz
gsoc2013-evolution-66587d89a30adfd7251dfd586e6213f9e9c536a0.tar.xz
gsoc2013-evolution-66587d89a30adfd7251dfd586e6213f9e9c536a0.tar.zst
gsoc2013-evolution-66587d89a30adfd7251dfd586e6213f9e9c536a0.zip
Keep a name-to-type hash so that we can make sure that the type has not
2001-12-11 Jeffrey Stedfast <fejj@ximian.com> * camel-object.c (camel_type_register): Keep a name-to-type hash so that we can make sure that the type has not yet been registered (prevents a race condition such as the one in bug #16559). * camel-service.c (camel_service_connect): Make sure that the connect_op is non-NULL before unregistering/unreffing it. svn path=/trunk/; revision=15021
Diffstat (limited to 'camel/camel-service.c')
-rw-r--r--camel/camel-service.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/camel/camel-service.c b/camel/camel-service.c
index ade9a1d5b2..9c32256fe0 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -260,10 +260,13 @@ camel_service_connect (CamelService *service, CamelException *ex)
service->status = ret ? CAMEL_SERVICE_CONNECTED : CAMEL_SERVICE_DISCONNECTED;
CAMEL_SERVICE_LOCK (service, connect_op_lock);
- if (unreg)
- camel_operation_unregister (service->connect_op);
- camel_operation_unref (service->connect_op);
- service->connect_op = NULL;
+ if (service->connect_op) {
+ if (unreg)
+ camel_operation_unregister (service->connect_op);
+
+ camel_operation_unref (service->connect_op);
+ service->connect_op = NULL;
+ }
CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
CAMEL_SERVICE_UNLOCK (service, connect_lock);