3

MFMailComposeViewControllerを使用して、アプリでメールを送信します。Instruments
アプリを実行すると、 タップしてメールを送信した後にリークが発生します。

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];
    }
4

1 に答える 1

1

ええ、そのように見えます。しかし、送信された電子メールごとに合計 64 バイトであるため、心配する必要はありません。

于 2012-05-01T21:53:33.737 に答える