[geary: 11/12] Fix crash when opening new IMAP client session as the engine is closing.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 11/12] Fix crash when opening new IMAP client session as the engine is closing.
- Date: Mon, 5 Mar 2018 12:21:04 +0000 (UTC)
commit 5b8618a573c861447280cc909e2a72556e37d785
Author: Michael James Gratton <mike vee net>
Date: Mon Mar 5 23:15:19 2018 +1100
Fix crash when opening new IMAP client session as the engine is closing.
.../imap-engine/imap-engine-generic-account.vala | 2 +-
.../transport/imap-client-session-manager.vala | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala
b/src/engine/imap-engine/imap-engine-generic-account.vala
index 7257deb..ece5d80 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -170,7 +170,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
if (!open)
return;
- // Stop trying to re-use IMAP server connections
+ // Block obtaining and reusing IMAP server connections
this.remote_ready_lock.reset();
this.session_pool.discard_returned_sessions = true;
diff --git a/src/engine/imap/transport/imap-client-session-manager.vala
b/src/engine/imap/transport/imap-client-session-manager.vala
index dc00891..e917710 100644
--- a/src/engine/imap/transport/imap-client-session-manager.vala
+++ b/src/engine/imap/transport/imap-client-session-manager.vala
@@ -444,15 +444,18 @@ public class Geary.Imap.ClientSessionManager : BaseObject {
try {
yield new_session.connect_async(cancellable);
} catch (Error err) {
- debug("[%s] Connect failure: %s", new_session.to_string(), err.message);
- connection_failed(err);
+ if (!(err is IOError.CANCELLED)) {
+ connection_failed(err);
+ }
throw err;
}
try {
yield new_session.initiate_session_async(this.credentials, cancellable);
} catch (Error err) {
- debug("[%s] Initiate session failure: %s", new_session.to_string(), err.message);
+ if (!(err is IOError.CANCELLED)) {
+ connection_failed(err);
+ }
// need to disconnect before throwing error ... don't honor Cancellable here, it's
// important to disconnect the client before dropping the ref
@@ -463,7 +466,6 @@ public class Geary.Imap.ClientSessionManager : BaseObject {
new_session.to_string(), disconnect_err.message);
}
- connection_failed(err);
throw err;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]