aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-21 18:29:33 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-21 18:29:33 +0800
commitb7982fcdefd1b5dfda43b486ae4b61da529bda4a (patch)
tree286c318aed2043427d49c3c9d33255e497e31f2f
parent8c87fce0494604bf07f392c6490ae64cedeaaeb4 (diff)
downloadgsoc2013-evolution-b7982fcdefd1b5dfda43b486ae4b61da529bda4a.tar
gsoc2013-evolution-b7982fcdefd1b5dfda43b486ae4b61da529bda4a.tar.gz
gsoc2013-evolution-b7982fcdefd1b5dfda43b486ae4b61da529bda4a.tar.bz2
gsoc2013-evolution-b7982fcdefd1b5dfda43b486ae4b61da529bda4a.tar.lz
gsoc2013-evolution-b7982fcdefd1b5dfda43b486ae4b61da529bda4a.tar.xz
gsoc2013-evolution-b7982fcdefd1b5dfda43b486ae4b61da529bda4a.tar.zst
gsoc2013-evolution-b7982fcdefd1b5dfda43b486ae4b61da529bda4a.zip
Bug #648468 - Disconnect service after mail fetching is done
-rw-r--r--mail/mail-ops.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 85805ffa5c..0b3e27d24e 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -214,6 +214,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
CamelFolder *folder = NULL;
CamelURL *url;
const gchar *uid;
+ gboolean is_local_delivery;
gint i;
fm->destination = e_mail_local_get_folder (
@@ -223,7 +224,8 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
g_object_ref (fm->destination);
url = camel_service_get_camel_url (CAMEL_SERVICE (m->store));
- if (em_utils_is_local_delivery_mbox_file (url)) {
+ is_local_delivery = em_utils_is_local_delivery_mbox_file (url);
+ if (is_local_delivery) {
gchar *path;
gchar *url_string;
@@ -333,6 +335,11 @@ fail:
g_object_unref (fm->driver);
fm->driver = NULL;
}
+
+ /* also disconnect if not a local delivery mbox;
+ there is no need to keep the connection alive forever */
+ if (!is_local_delivery)
+ camel_service_disconnect_sync (CAMEL_SERVICE (m->store), TRUE, NULL);
}
static void