aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/imap
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-03-29 23:53:42 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-03-29 23:53:42 -0700
commita536d04f543ca0b8a2f3bc9ec28f3424b390355a (patch)
treef5f935e6e83e77a4aa0006157ef2c8a883602d4a /src/async/imap
parent7d80e3d568554f0c742a41bb9c9af567d71b5b83 (diff)
Fixed dispatch queue memory management.
Diffstat (limited to 'src/async/imap')
-rwxr-xr-xsrc/async/imap/MCIMAPAsyncSession.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/async/imap/MCIMAPAsyncSession.cc b/src/async/imap/MCIMAPAsyncSession.cc
index c037768f..e94b62fe 100755
--- a/src/async/imap/MCIMAPAsyncSession.cc
+++ b/src/async/imap/MCIMAPAsyncSession.cc
@@ -50,6 +50,11 @@ IMAPAsyncSession::IMAPAsyncSession()
IMAPAsyncSession::~IMAPAsyncSession()
{
+#if __APPLE__
+ if (mDispatchQueue != NULL) {
+ dispatch_release(mDispatchQueue);
+ }
+#endif
MC_SAFE_RELEASE(mGmailUserDisplayName);
MC_SAFE_RELEASE(mServerIdentity);
MC_SAFE_RELEASE(mClientIdentity);
@@ -602,7 +607,13 @@ void IMAPAsyncSession::operationRunningStateChanged()
#if __APPLE__
void IMAPAsyncSession::setDispatchQueue(dispatch_queue_t dispatchQueue)
{
+ if (mDispatchQueue != NULL) {
+ dispatch_release(mDispatchQueue);
+ }
mDispatchQueue = dispatchQueue;
+ if (mDispatchQueue != NULL) {
+ dispatch_retain(mDispatchQueue);
+ }
}
dispatch_queue_t IMAPAsyncSession::dispatchQueue()