Permalink
Browse files

Reverting mem leak fix, seems to be causing crashers

  • Loading branch information...
1 parent 2eeb378 commit 1ce31638f14cf6df5f9689bc025ed8dbd05d40d3 @mronge mronge committed Nov 26, 2012
Showing with 5 additions and 28 deletions.
  1. +5 −28 Source/CTCoreMessage.m
View
@@ -90,7 +90,9 @@ - (void)dealloc {
mailmessage_flush(myMessage);
mailmessage_free(myMessage);
}
- [self _releaseMailimfSingleFields: myFields];
+ if (myFields != NULL) {
+ mailimf_single_fields_free(myFields);
+ }
self.lastError = nil;
self.parentFolder = nil;
[myParsedMIME release];
@@ -139,7 +141,8 @@ - (void)setBodyStructure:(struct mailmime *)mime {
}
- (void)setFields:(struct mailimf_fields *)fields {
- [self _releaseMailimfSingleFields: myFields];
+ if (myFields != NULL)
+ mailimf_single_fields_free(myFields);
myFields = mailimf_single_fields_new(fields);
}
@@ -815,30 +818,4 @@ - (clist *)_clistFromStringArray:(NSArray *)strings {
return str_list;
}
-- (void)_releaseMailimfSingleFields:(struct mailimf_single_fields *)fields {
-
- /**
- The LibEtPan API states:
- mailimf_single_fields_free() frees memory used by the structure and
- substructures will NOT be released. They should be released by the application.
- */
-
- if (fields) {
- if (fields->fld_bcc) mailimf_bcc_free(fields->fld_bcc);
- if (fields->fld_cc) mailimf_cc_free(fields->fld_cc);
- if (fields->fld_comments) mailimf_comments_free(fields->fld_comments);
- if (fields->fld_from) mailimf_from_free(fields->fld_from);
- if (fields->fld_in_reply_to) mailimf_in_reply_to_free(fields->fld_in_reply_to);
- if (fields->fld_keywords) mailimf_keywords_free(fields->fld_keywords);
- if (fields->fld_message_id) mailimf_message_id_free(fields->fld_message_id);
- if (fields->fld_orig_date) mailimf_orig_date_free(fields->fld_orig_date);
- if (fields->fld_references) mailimf_references_free(fields->fld_references);
- if (fields->fld_reply_to) mailimf_reply_to_free(fields->fld_reply_to);
- if (fields->fld_sender) mailimf_sender_free(fields->fld_sender);
- if (fields->fld_subject) mailimf_subject_free(fields->fld_subject);
- if (fields->fld_to) mailimf_to_free(fields->fld_to);
- mailimf_single_fields_free(fields);
- }
-}
-
@end

0 comments on commit 1ce3163

Please sign in to comment.