Dont re-register the connect_op if we got it by calling
author7 <NotZed@Ximian.com>
Thu, 27 Sep 2001 23:24:01 +0000 (23:24 +0000)
committerMichael Zucci <zucchi@src.gnome.org>
Thu, 27 Sep 2001 23:24:01 +0000 (23:24 +0000)
2001-09-27    <NotZed@Ximian.com>

* camel-service.c (camel_service_connect): Dont re-register the
connect_op if we got it by calling 'operation_registered', which
returns an already-registered one.
(camel_service_disconnect): Likewise here.
This removes all the re-registered warnings.

camel/ChangeLog
camel/camel-service.c

index b3eccf0..8c77bf2 100644 (file)
@@ -1,5 +1,11 @@
 2001-09-27    <NotZed@Ximian.com>
 
+       * camel-service.c (camel_service_connect): Dont re-register the
+       connect_op if we got it by calling 'operation_registered', which
+       returns an already-registered one.
+       (camel_service_disconnect): Likewise here.
+        This removes all the re-registered warnings.
+
        * camel-object.c (camel_object_unref): Fill the finalised data
        with nonsense, rather than 0's - more easily detect bad data.
        (camel_object_new): Clear instance data when we retrieve it off
index cc254e1..fed8945 100644 (file)
@@ -247,9 +247,10 @@ camel_service_connect (CamelService *service, CamelException *ex)
         */
        CAMEL_SERVICE_LOCK (service, connect_op_lock);
        service->connect_op = camel_operation_registered ();
-       if (!service->connect_op)
+       if (!service->connect_op) {
                service->connect_op = camel_operation_new (NULL, NULL);
-       camel_operation_register (service->connect_op);
+               camel_operation_register (service->connect_op);
+       }
        CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
 
        service->status = CAMEL_SERVICE_CONNECTING;
@@ -301,9 +302,10 @@ camel_service_disconnect (CamelService *service, gboolean clean,
        if (service->status == CAMEL_SERVICE_CONNECTED) {
                CAMEL_SERVICE_LOCK (service, connect_op_lock);
                service->connect_op = camel_operation_registered ();
-               if (!service->connect_op)
+               if (!service->connect_op) {
                        service->connect_op = camel_operation_new (NULL, NULL);
-               camel_operation_register (service->connect_op);
+                       camel_operation_register (service->connect_op);
+               }
                CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
 
                service->status = CAMEL_SERVICE_DISCONNECTING;