diff options
author | Hilmar Gústafsson <LiHRaM@users.noreply.github.com> | 2017-10-16 21:01:39 +0200 |
---|---|---|
committer | Hoà V. DINH <dinh.viet.hoa@gmail.com> | 2017-10-16 12:01:39 -0700 |
commit | 358db2bbdc59775f4bdc06344032d85e8400d7e0 (patch) | |
tree | d53b2e61e69313fcce21cf17bf46664ea70eeafa | |
parent | f783ab13afb9a6e79dfa2fdaedd6cc74324fa880 (diff) |
Fix intermittent crashes on iOS - added to header file. (#1673)
Fix intermittent crashes on iOS
-rw-r--r-- | src/async/imap/MCIMAPOperation.cpp | 7 | ||||
-rw-r--r-- | src/async/imap/MCIMAPOperation.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/async/imap/MCIMAPOperation.cpp b/src/async/imap/MCIMAPOperation.cpp index 724c8215..e0dae173 100644 --- a/src/async/imap/MCIMAPOperation.cpp +++ b/src/async/imap/MCIMAPOperation.cpp @@ -178,8 +178,15 @@ void IMAPOperation::beforeMain() void IMAPOperation::afterMain() { + retain(); + performMethodOnMainThread((Object::Method) &IMAPOperation::afterMainOnMainThread, NULL); +} + +void IMAPOperation::afterMainOnMainThread() +{ if (mSession->session()->isAutomaticConfigurationDone()) { mSession->owner()->automaticConfigurationDone(mSession->session()); mSession->session()->resetAutomaticConfigurationDone(); } + release(); } diff --git a/src/async/imap/MCIMAPOperation.h b/src/async/imap/MCIMAPOperation.h index a57d7489..a1dbbbb2 100644 --- a/src/async/imap/MCIMAPOperation.h +++ b/src/async/imap/MCIMAPOperation.h @@ -43,6 +43,7 @@ namespace mailcore { virtual void beforeMain(); virtual void afterMain(); + virtual void afterMainOnMainThread(); virtual void start(); |