From: Milan Crha Date: Tue, 7 Aug 2012 17:04:39 +0000 (+0200) Subject: Fix regression after move to GSimpleAsyncResult in camel_service_disconnect X-Git-Tag: upstream/3.7.4~587 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2049ab201f4b8f936a6273860fcb591ff8db1a5b;p=platform%2Fupstream%2Fevolution-data-server.git 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. --- 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);