From 6d313c9f852aa608b6e841e2ae42ab345cf6bc4b Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sat, 12 Aug 2000 21:59:41 +0000 Subject: Don't ref the store returned from camel_session_get_store. It's already * mail-tools.c (mail_tool_get_folder_from_urlname): Don't ref the store returned from camel_session_get_store. It's already reffed. (mail_tool_get_root_of_store): Ditto. (mail_tool_send_via_transport): Remove some commented-out code and fix it to not leave the transport connected if sending fails. svn path=/trunk/; revision=4783 --- mail/mail-tools.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'mail/mail-tools.c') diff --git a/mail/mail-tools.c b/mail/mail-tools.c index d335416885..9e047ab3fb 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -101,8 +101,6 @@ mail_tool_get_folder_from_urlname (const gchar *url, const gchar *name, return NULL; } - camel_object_ref (CAMEL_OBJECT (store)); - camel_service_connect (CAMEL_SERVICE (store), ex); if (camel_exception_is_set (ex)) { camel_object_unref (CAMEL_OBJECT (store)); @@ -393,24 +391,16 @@ void mail_tool_send_via_transport (CamelTransport *transport, CamelMedium *medium, CamelException *ex) { mail_tool_camel_lock_up(); - /*camel_object_ref (CAMEL_OBJECT (transport));*/ - /*camel_object_ref (CAMEL_OBJECT (medium));*/ camel_service_connect (CAMEL_SERVICE (transport), ex); - if (camel_exception_is_set (ex)) goto cleanup; camel_transport_send (transport, medium, ex); - if (camel_exception_is_set (ex)) - goto cleanup; - - camel_service_disconnect (CAMEL_SERVICE (transport), ex); - + camel_service_disconnect (CAMEL_SERVICE (transport), + camel_exception_is_set (ex) ? NULL : ex); cleanup: - /*camel_object_unref (CAMEL_OBJECT (medium));*/ - /*camel_object_unref (CAMEL_OBJECT (transport));*/ mail_tool_camel_lock_down(); } @@ -564,8 +554,6 @@ mail_tool_get_root_of_store (const char *source_uri, CamelException *ex) return NULL; } - camel_object_ref (CAMEL_OBJECT (store)); - camel_service_connect (CAMEL_SERVICE (store), ex); if (camel_exception_is_set (ex)) { camel_object_unref (CAMEL_OBJECT (store)); -- cgit v1.2.3