ios - MFMailComposeViewController never deallocates -


i'm presenting mfmailcomposeviewcontroller this:

mc = [[mfmailcomposeviewcontroller alloc] init]; mc.mailcomposedelegate = self; [self presentviewcontroller:mc animated:yes completion:null];  mc = nil; 

and removing delegate method:

- (void) mailcomposecontroller:(mfmailcomposeviewcontroller *)controller didfinishwithresult:(mfmailcomposeresult)result error:(nserror *)error {    [self dismissviewcontrolleranimated:yes completion:nil]; } 

the problem vc never deallocated, , opening , closing "send email" function in app eats memory doesn't release it.

what missing? don't see how can other way, , other vcs deallocate fine on own after calling dismissviewcontroller on themselves.

why set mc = nil; after presentviewcontroller:mc?

you should like:-

mc = [[mfmailcomposeviewcontroller alloc] init]; mc.mailcomposedelegate = self; [self presentviewcontroller:mc animated:yes completion:null]; 

then

- (void) mailcomposecontroller:(mfmailcomposeviewcontroller *)controller              didfinishwithresult:(mfmailcomposeresult)result error:(nserror *)error {  [self dismissviewcontrolleranimated:yes completion:^{     mc=nil; }]; } 

by way, mfmailcomposeviewcontroller has memory leak issue. not problem, have same problem.

  1. cancelling mfmailcomposeviewcontroller causes memory leak?

  2. memory leak mfmailcomposeviewcontroller on send mail


Comments

Popular posts from this blog

android - Automated my builds -

how to proxy from https to http with lighttpd -

python - Flask migration error -