diff options
Diffstat (limited to 'src/objc')
-rw-r--r-- | src/objc/abstract/MCOAbstractMessage+Private.h | 1 | ||||
-rw-r--r-- | src/objc/abstract/MCOAbstractMessage.mm | 5 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPMessage.mm | 3 | ||||
-rw-r--r-- | src/objc/rfc822/MCOAttachment.mm | 2 | ||||
-rw-r--r-- | src/objc/rfc822/MCOMessageBuilder.mm | 3 |
5 files changed, 11 insertions, 3 deletions
diff --git a/src/objc/abstract/MCOAbstractMessage+Private.h b/src/objc/abstract/MCOAbstractMessage+Private.h index e3f37128..7c89f17d 100644 --- a/src/objc/abstract/MCOAbstractMessage+Private.h +++ b/src/objc/abstract/MCOAbstractMessage+Private.h @@ -19,6 +19,7 @@ namespace mailcore { @interface MCOAbstractMessage (Private) - (id) initWithMCMessage:(mailcore::AbstractMessage *)message; +- (void) setMCMessage:(mailcore::AbstractMessage *)message; @end diff --git a/src/objc/abstract/MCOAbstractMessage.mm b/src/objc/abstract/MCOAbstractMessage.mm index a1eb4250..33a28193 100644 --- a/src/objc/abstract/MCOAbstractMessage.mm +++ b/src/objc/abstract/MCOAbstractMessage.mm @@ -44,6 +44,11 @@ return self; } +- (void) setMessage:(mailcore::AbstractMessage *)message +{ + MC_SAFE_REPLACE_RETAIN(mailcore::AbstractMessage, _message, message); +} + - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); diff --git a/src/objc/imap/MCOIMAPMessage.mm b/src/objc/imap/MCOIMAPMessage.mm index d7d499ef..bf952b83 100644 --- a/src/objc/imap/MCOIMAPMessage.mm +++ b/src/objc/imap/MCOIMAPMessage.mm @@ -28,7 +28,8 @@ - (id) init { mailcore::IMAPMessage * msg = new mailcore::IMAPMessage(); - self = [self initWithMCMessage:msg]; + self = [super init]; + [self setMCMessage:msg]; msg->release(); return self; } diff --git a/src/objc/rfc822/MCOAttachment.mm b/src/objc/rfc822/MCOAttachment.mm index afaf96af..77a642d6 100644 --- a/src/objc/rfc822/MCOAttachment.mm +++ b/src/objc/rfc822/MCOAttachment.mm @@ -35,7 +35,7 @@ - (id) init { mailcore::Attachment * attachment = new mailcore::Attachment(); - self = [self initWithMCPart:attachment]; + self = [super initWithMCPart:attachment]; attachment->release(); return self; diff --git a/src/objc/rfc822/MCOMessageBuilder.mm b/src/objc/rfc822/MCOMessageBuilder.mm index 090fc99d..3531caf9 100644 --- a/src/objc/rfc822/MCOMessageBuilder.mm +++ b/src/objc/rfc822/MCOMessageBuilder.mm @@ -26,7 +26,8 @@ - (id)init { mailcore::MessageBuilder * message = new mailcore::MessageBuilder(); - self = [super initWithMCMessage:message]; + self = [super init]; + [self setMCMessage:message]; MC_SAFE_RELEASE(message); return self; } |