diff options
Diffstat (limited to 'src/objc')
19 files changed, 36 insertions, 12 deletions
diff --git a/src/objc/imap/MCOIMAPAppendMessageOperation.mm b/src/objc/imap/MCOIMAPAppendMessageOperation.mm index 16463016..c281b925 100644 --- a/src/objc/imap/MCOIMAPAppendMessageOperation.mm +++ b/src/objc/imap/MCOIMAPAppendMessageOperation.mm @@ -57,6 +57,8 @@ typedef void (^CompletionType)(NSError *error, uint32_t createdUID); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], 0); } + [_completionBlock release]; + _completionBlock = nil; } - (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum diff --git a/src/objc/imap/MCOIMAPCapabilityOperation.mm b/src/objc/imap/MCOIMAPCapabilityOperation.mm index 048475c9..42952378 100644 --- a/src/objc/imap/MCOIMAPCapabilityOperation.mm +++ b/src/objc/imap/MCOIMAPCapabilityOperation.mm @@ -53,6 +53,8 @@ typedef void (^CompletionType)(NSError *error, MCOIndexSet * capabilities); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/imap/MCOIMAPCopyMessagesOperation.mm b/src/objc/imap/MCOIMAPCopyMessagesOperation.mm index 8f7bf501..d14bcc84 100644 --- a/src/objc/imap/MCOIMAPCopyMessagesOperation.mm +++ b/src/objc/imap/MCOIMAPCopyMessagesOperation.mm @@ -54,6 +54,8 @@ typedef void (^CompletionType)(NSError *error, MCOIndexSet * destUids); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], 0); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/imap/MCOIMAPFetchContentOperation.mm b/src/objc/imap/MCOIMAPFetchContentOperation.mm index 984751c0..d5d4757d 100644 --- a/src/objc/imap/MCOIMAPFetchContentOperation.mm +++ b/src/objc/imap/MCOIMAPFetchContentOperation.mm @@ -57,6 +57,8 @@ typedef void (^CompletionType)(NSError *error, NSData * data); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } - (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum diff --git a/src/objc/imap/MCOIMAPFetchFoldersOperation.mm b/src/objc/imap/MCOIMAPFetchFoldersOperation.mm index 53017c90..02b7d880 100644 --- a/src/objc/imap/MCOIMAPFetchFoldersOperation.mm +++ b/src/objc/imap/MCOIMAPFetchFoldersOperation.mm @@ -58,6 +58,8 @@ typedef void (^CompletionType)(NSError *error, NSArray *folder); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/imap/MCOIMAPFetchMessagesOperation.mm b/src/objc/imap/MCOIMAPFetchMessagesOperation.mm index e43a46e5..6892ab1b 100644 --- a/src/objc/imap/MCOIMAPFetchMessagesOperation.mm +++ b/src/objc/imap/MCOIMAPFetchMessagesOperation.mm @@ -53,6 +53,8 @@ typedef void (^CompletionType)(NSError *error, NSArray * messages, MCOIndexSet * } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil, nil); } + [_completionBlock release]; + _completionBlock = nil; } - (void) itemProgress:(unsigned int)current maximum:(unsigned int)maximum diff --git a/src/objc/imap/MCOIMAPFetchNamespaceOperation.mm b/src/objc/imap/MCOIMAPFetchNamespaceOperation.mm index aaa02c96..861298bf 100644 --- a/src/objc/imap/MCOIMAPFetchNamespaceOperation.mm +++ b/src/objc/imap/MCOIMAPFetchNamespaceOperation.mm @@ -53,6 +53,8 @@ typedef void (^CompletionType)(NSError *error, NSDictionary * namespaces); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/imap/MCOIMAPFolderInfoOperation.mm b/src/objc/imap/MCOIMAPFolderInfoOperation.mm index 37b1a649..61766073 100644 --- a/src/objc/imap/MCOIMAPFolderInfoOperation.mm +++ b/src/objc/imap/MCOIMAPFolderInfoOperation.mm @@ -61,6 +61,8 @@ typedef void (^CompletionType)(NSError *error, MCOIMAPFolderInfo *info); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/imap/MCOIMAPFolderStatusOperation.mm b/src/objc/imap/MCOIMAPFolderStatusOperation.mm index c7f5370c..2420e0b9 100644 --- a/src/objc/imap/MCOIMAPFolderStatusOperation.mm +++ b/src/objc/imap/MCOIMAPFolderStatusOperation.mm @@ -55,6 +55,8 @@ typedef void (^CompletionType)(NSError *error, MCOIMAPFolderStatus *status); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/imap/MCOIMAPIdentityOperation.mm b/src/objc/imap/MCOIMAPIdentityOperation.mm index acc5ea10..f02fbba5 100644 --- a/src/objc/imap/MCOIMAPIdentityOperation.mm +++ b/src/objc/imap/MCOIMAPIdentityOperation.mm @@ -53,6 +53,8 @@ typedef void (^CompletionType)(NSError *error, NSDictionary * serverIdentity); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/imap/MCOIMAPIdleOperation.mm b/src/objc/imap/MCOIMAPIdleOperation.mm index 86419b75..d43bf818 100644 --- a/src/objc/imap/MCOIMAPIdleOperation.mm +++ b/src/objc/imap/MCOIMAPIdleOperation.mm @@ -53,6 +53,8 @@ typedef void (^CompletionType)(NSError *error); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()]); } + [_completionBlock release]; + _completionBlock = nil; } - (void) interruptIdle diff --git a/src/objc/imap/MCOIMAPOperation.mm b/src/objc/imap/MCOIMAPOperation.mm index 7b98c6bd..0b6d48e0 100644 --- a/src/objc/imap/MCOIMAPOperation.mm +++ b/src/objc/imap/MCOIMAPOperation.mm @@ -38,6 +38,8 @@ typedef void (^CompletionType)(NSError *error); NSError * error = [NSError mco_errorWithErrorCode:MCO_NATIVE_INSTANCE->error()]; _completionBlock(error); + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/imap/MCOIMAPSearchOperation.mm b/src/objc/imap/MCOIMAPSearchOperation.mm index 92f57b62..730c73a0 100644 --- a/src/objc/imap/MCOIMAPSearchOperation.mm +++ b/src/objc/imap/MCOIMAPSearchOperation.mm @@ -54,6 +54,8 @@ typedef void (^CompletionType)(NSError *error, MCOIndexSet * searchResult); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/pop/MCOPOPFetchHeaderOperation.mm b/src/objc/pop/MCOPOPFetchHeaderOperation.mm index 1d2c35c6..ab467a76 100644 --- a/src/objc/pop/MCOPOPFetchHeaderOperation.mm +++ b/src/objc/pop/MCOPOPFetchHeaderOperation.mm @@ -54,6 +54,8 @@ typedef void (^CompletionType)(NSError *error, MCOMessageHeader * header); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } @end diff --git a/src/objc/pop/MCOPOPFetchMessageOperation.mm b/src/objc/pop/MCOPOPFetchMessageOperation.mm index 40740961..02bad3ad 100644 --- a/src/objc/pop/MCOPOPFetchMessageOperation.mm +++ b/src/objc/pop/MCOPOPFetchMessageOperation.mm @@ -90,6 +90,8 @@ private: } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } - (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum diff --git a/src/objc/pop/MCOPOPFetchMessagesOperation.mm b/src/objc/pop/MCOPOPFetchMessagesOperation.mm index dcb35845..2fe9b31f 100644 --- a/src/objc/pop/MCOPOPFetchMessagesOperation.mm +++ b/src/objc/pop/MCOPOPFetchMessagesOperation.mm @@ -54,6 +54,8 @@ typedef void (^CompletionType)(NSError *error, NSArray * messages); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } + [_completionBlock release]; + _completionBlock = nil; } diff --git a/src/objc/pop/MCOPOPOperation.mm b/src/objc/pop/MCOPOPOperation.mm index 9b58f84d..5f4d1f59 100644 --- a/src/objc/pop/MCOPOPOperation.mm +++ b/src/objc/pop/MCOPOPOperation.mm @@ -41,6 +41,8 @@ typedef void (^CompletionType)(NSError *error); NSError * error = [NSError mco_errorWithErrorCode:MCO_NATIVE_INSTANCE->error()]; _completionBlock(error); + [_completionBlock release]; + _completionBlock = nil; } - (void) setSession:(MCOPOPSession *)session diff --git a/src/objc/smtp/MCOSMTPOperation.mm b/src/objc/smtp/MCOSMTPOperation.mm index cd52ad13..9d96613f 100644 --- a/src/objc/smtp/MCOSMTPOperation.mm +++ b/src/objc/smtp/MCOSMTPOperation.mm @@ -41,6 +41,8 @@ typedef void (^CompletionType)(NSError *error); NSError * error = [NSError mco_errorWithErrorCode:MCO_NATIVE_INSTANCE->error()]; _completionBlock(error); + [_completionBlock release]; + _completionBlock = NULL; } - (void) setSession:(MCOSMTPSession *)session diff --git a/src/objc/smtp/MCOSMTPSendOperation.mm b/src/objc/smtp/MCOSMTPSendOperation.mm index e41a9f5a..776f7270 100644 --- a/src/objc/smtp/MCOSMTPSendOperation.mm +++ b/src/objc/smtp/MCOSMTPSendOperation.mm @@ -80,18 +80,6 @@ private: [self start]; } -- (void)operationCompleted { - if (_completionBlock == NULL) - return; - - nativeType *op = MCO_NATIVE_INSTANCE; - if (op->error() == mailcore::ErrorNone) { - _completionBlock(nil); - } else { - _completionBlock([NSError mco_errorWithErrorCode:op->error()]); - } -} - - (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum { if (_progress != NULL) { |