diff options
author | Hoa V. Dinh <dinh.viet.hoa@gmail.com> | 2013-07-25 22:58:37 -0700 |
---|---|---|
committer | Hoa V. Dinh <dinh.viet.hoa@gmail.com> | 2013-07-25 22:58:37 -0700 |
commit | a2013b0a10771637f5a3d7beaf67bb6ea1d0bf9a (patch) | |
tree | 58c54d6f1bda281f2175a026b6ed518b93e35c45 | |
parent | 9699ff4d1f5c510eb287c433ecf7f23892c9d869 (diff) |
Fixed memory leak in MCIMAPOperation
-rw-r--r-- | src/async/imap/MCIMAPOperation.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/async/imap/MCIMAPOperation.cc b/src/async/imap/MCIMAPOperation.cc index a983fe55..35eedd6c 100644 --- a/src/async/imap/MCIMAPOperation.cc +++ b/src/async/imap/MCIMAPOperation.cc @@ -94,8 +94,10 @@ void IMAPOperation::bodyProgress(IMAPSession * session, unsigned int current, un void IMAPOperation::bodyProgressOnMainThread(void * ctx) { - if (isCancelled()) + if (isCancelled()) { + release(); return; + } struct progressContext * context = (struct progressContext *) ctx; if (mImapCallback != NULL) { @@ -107,10 +109,8 @@ void IMAPOperation::bodyProgressOnMainThread(void * ctx) void IMAPOperation::itemsProgress(IMAPSession * session, unsigned int current, unsigned int maximum) { - if (isCancelled()) { - release(); + if (isCancelled()) return; - } struct progressContext * context = (struct progressContext *) calloc(sizeof(* context), 1); context->current = current; |