aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-09-08 06:54:54 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-09-08 06:54:54 +0800
commit18f64d591747716a8e0cafd7c4ba4007f6cbf2f4 (patch)
tree64491e322b58301cb27f71db2c91a63f534a000c
parent325fb5714b03624cc7f90d00a57d23b435b943c5 (diff)
downloadgsoc2013-evolution-18f64d591747716a8e0cafd7c4ba4007f6cbf2f4.tar
gsoc2013-evolution-18f64d591747716a8e0cafd7c4ba4007f6cbf2f4.tar.gz
gsoc2013-evolution-18f64d591747716a8e0cafd7c4ba4007f6cbf2f4.tar.bz2
gsoc2013-evolution-18f64d591747716a8e0cafd7c4ba4007f6cbf2f4.tar.lz
gsoc2013-evolution-18f64d591747716a8e0cafd7c4ba4007f6cbf2f4.tar.xz
gsoc2013-evolution-18f64d591747716a8e0cafd7c4ba4007f6cbf2f4.tar.zst
gsoc2013-evolution-18f64d591747716a8e0cafd7c4ba4007f6cbf2f4.zip
Disconnect from the service here otherwise the locks will be destroyed and
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. svn path=/trunk/; revision=12692
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/camel-remote-store.c20
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);
}