From 18f64d591747716a8e0cafd7c4ba4007f6cbf2f4 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 7 Sep 2001 22:54:54 +0000 Subject: Disconnect from the service here otherwise the locks will be destroyed and 2001-09-07 Jeffrey Stedfast * camel-remote-store.c (camel_remote_store_finalise): Disconnect from the service here otherwise the locks will be destroyed and by the time CamelService finalizes we'll crash or hang. svn path=/trunk/; revision=12692 --- camel/ChangeLog | 4 ++++ camel/camel-remote-store.c | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 7c0a5dcfe0..3a23bb94d3 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,9 @@ 2001-09-07 Jeffrey Stedfast + * camel-remote-store.c (camel_remote_store_finalise): Disconnect + from the service here otherwise the locks will be destroyed and by + the time CamelService finalizes we'll crash or hang. + * providers/smtp/camel-smtp-transport.c (smtp_data): Make sure to unref the mime filters when we finish with them. diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index 4715019179..00f8dce4f4 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -124,14 +124,26 @@ camel_remote_store_init (CamelObject *object) } static void -camel_remote_store_finalise(CamelObject *object) +camel_remote_store_finalise (CamelObject *object) { CamelRemoteStore *remote_store = CAMEL_REMOTE_STORE (object); - + CamelService *service = CAMEL_SERVICE (object); + + if (service->connected) { + CamelException ex; + + camel_exception_init (&ex); + camel_service_disconnect (service, TRUE, &ex); + if (camel_exception_is_set (&ex)) { + g_warning ("camel_remote_store_finalize: silent disconnect failure: %s", + camel_exception_get_description (&ex)); + } + } + #ifdef ENABLE_THREADS - e_mutex_destroy(remote_store->priv->stream_lock); + e_mutex_destroy (remote_store->priv->stream_lock); #endif - g_free(remote_store->priv); + g_free (remote_store->priv); } -- cgit