2012-05-01 54 views
3

我使用MFMailComposeViewController在我的應用程序發送電子郵件。
當我運行我的應用程序儀器,
我發現電子郵件後發現泄漏。iPhone - 漏洞在MessageUI框架?

Leaked Object # Address Size Responsible Library Responsible Frame 

MutableMessageHeaders,1 0x6be950 32 Bytes MessageUI +[MFComposeTypeFactory headersFromDelegate:] 

_MFOutgoingMessageBody,1 0x1190ed0 32 Bytes Message -[MessageWriter createMessageWithPlainTextDocumentsAndAttachments:headers:] 

你知道如何解決它,
這是MessageUI框架泄漏?

- (void)showMailComposer 
{ 
     MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; 
     picker.mailComposeDelegate = self; 
     [picker setSubject:@"Subject"]; 
     NSString *emailBody = @"Email body"; 
     [picker setMessageBody:emailBody isHTML:NO]; 
     [self presentModalViewController:picker animated:YES]; 
     [picker release]; 
} 

#pragma mark - 
#pragma mark Dismiss Mail/SMS view controller 

    // Dismisses the email composition interface when users tap Cancel or Send. Proceeds to update the 
    // message field with the result of the operation. 
    - (void)mailComposeController:(MFMailComposeViewController*)controller 
       didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{ 
      [self dismissModalViewControllerAnimated:YES]; 
    } 
+0

發佈您的代碼。 – Dancreek

回答

1

是的,看起來像。但是每發送一封電子郵件總共有64字節,這不是你應該擔心的問題。

+0

討厭成爲snoot。但是,這似乎是流行的意見......而且我發現隨着每個操作系統更新,內存泄漏的速度都會增加。所有這一切意味着用戶必須更頻繁地重新啓動手機。與此同時,蘋果公司告訴我們盡一切努力使用戶體驗更好......嗯。 – stephen