[evolution/gnome-3-0] Bug #648468 - Disconnect service after mail fetching is done



commit 10710cd23cca94d9b3df818aa48b8eb8f3af1c29
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jun 21 12:32:07 2011 +0200

    Bug #648468 - Disconnect service after mail fetching is done

 mail/mail-ops.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 79fce90..338e83f 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -322,11 +322,18 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
 				em_filter_folder_element_exec (fm, cancellable, error);
 			}
 
+			g_object_ref (parent_store);
+
 			/* we unref the source folder here since we
 			   may now block in finalize (we try to
 			   disconnect cleanly) */
 			g_object_unref (fm->source_folder);
 			fm->source_folder = NULL;
+
+			/* also disconnect if not a local delivery mbox;
+			   there is no need to keep the connection alive forever */
+			camel_service_disconnect_sync (CAMEL_SERVICE (parent_store), TRUE, NULL);
+			g_object_unref (parent_store);
 		}
 	}
 fail:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]