Skip to content

Commit

Permalink
Discarding Draft or Sending Mail sometimes crashes app or sometimes j…
Browse files Browse the repository at this point in the history
…ust wont close mail view #7
  • Loading branch information
EddyVerbruggen committed Nov 22, 2016
1 parent 59acc03 commit d2c28c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions email.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ exports.compose = function (arg) {
resolve(result == MFMailComposeResultSent);
// close the mail
app.keyWindow.rootViewController.dismissViewControllerAnimatedCompletion(true, null);
// Remove the local variable for the delegate.
delegate = undefined;
// release the delegate instance
CFRelease(delegate);
});

// retain the delegate because the mailComposeDelegate property won't do it for us
CFRetain(delegate);

mail.mailComposeDelegate = delegate;

app.keyWindow.rootViewController.presentViewControllerAnimatedCompletion(mail, true, null);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-email",
"version": "1.3.3",
"version": "1.3.4",
"description": "Email plugin for your NativeScript app",
"main": "email.js",
"typings": "email.d.ts",
Expand Down

0 comments on commit d2c28c1

Please sign in to comment.