diff options
-rw-r--r-- | camel/ChangeLog | 4 | ||||
-rw-r--r-- | 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 <fejj@ximian.com> + * 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); } |