aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/smtp/MCOSMTPSendOperation.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/objc/smtp/MCOSMTPSendOperation.mm')
-rw-r--r--src/objc/smtp/MCOSMTPSendOperation.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/objc/smtp/MCOSMTPSendOperation.mm b/src/objc/smtp/MCOSMTPSendOperation.mm
index 776f7270..8a7d5b04 100644
--- a/src/objc/smtp/MCOSMTPSendOperation.mm
+++ b/src/objc/smtp/MCOSMTPSendOperation.mm
@@ -80,6 +80,18 @@ private:
[self start];
}
+// This method needs to be duplicated from MCOSMTPOperation since _completionBlock
+// references the instance of this subclass and not the one from MCOSMTPOperation.
+- (void)operationCompleted {
+ if (_completionBlock == NULL)
+ return;
+
+ NSError * error = [NSError mco_errorWithErrorCode:MCO_NATIVE_INSTANCE->error()];
+ _completionBlock(error);
+ [_completionBlock release];
+ _completionBlock = NULL;
+}
+
- (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum
{
if (_progress != NULL) {