[evolution-data-server] Fix regression after move to GSimpleAsyncResult in camel_service_disconnect



commit 2049ab201f4b8f936a6273860fcb591ff8db1a5b
Author: Milan Crha <mcrha redhat com>
Date:   Tue Aug 7 19:04:39 2012 +0200

    Fix regression after move to GSimpleAsyncResult in camel_service_disconnect
    
    IMAP provider called disconnect in its finalize method, it was all fine
    until move to GSimpleAsyncResult, which requires "live" GObject, which
    is not true when called from finalize, thus everything breaks.
    Moving the disconnect call to dispose function fixes this.
    This was recognized when creating a new IMAP account and querying
    for authentication methods.

 camel/providers/imap/camel-imap-store.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index db6422e..5d95e5c 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -762,6 +762,10 @@ imap_store_dispose (GObject *object)
 {
 	CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
 
+	/* This frees current_folder, folders, authtypes, streams, and namespace. */
+	camel_service_disconnect_sync (
+		CAMEL_SERVICE (imap_store), TRUE, NULL, NULL);
+
 	if (imap_store->summary != NULL) {
 		camel_store_summary_save (
 			CAMEL_STORE_SUMMARY (imap_store->summary));
@@ -778,10 +782,6 @@ imap_store_finalize (GObject *object)
 {
 	CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
 
-	/* This frees current_folder, folders, authtypes, streams, and namespace. */
-	camel_service_disconnect_sync (
-		CAMEL_SERVICE (imap_store), TRUE, NULL, NULL);
-
 	g_static_rec_mutex_free (&imap_store->command_and_response_lock);
 	g_hash_table_destroy (imap_store->known_alerts);
 



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