You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/10/21 19:25:12 UTC
git commit: CB-4995 Fix crash when WebView is quickly opened then
closed.
Updated Branches:
refs/heads/dev c7972b6cf -> aa81c3267
CB-4995 Fix crash when WebView is quickly opened then closed.
Also fixes a leak where callback was never being cleared.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/aa81c326
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/aa81c326
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/aa81c326
Branch: refs/heads/dev
Commit: aa81c3267a5b1c337b09933ff5ceb06a93f9dbb7
Parents: c7972b6
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Oct 21 13:16:54 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Oct 21 13:19:13 2013 -0400
----------------------------------------------------------------------
src/ios/CDVInAppBrowser.m | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/aa81c326/src/ios/CDVInAppBrowser.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m
index 5711e76..4ef051f 100644
--- a/src/ios/CDVInAppBrowser.m
+++ b/src/ios/CDVInAppBrowser.m
@@ -56,12 +56,8 @@
- (void)close:(CDVInvokedUrlCommand*)command
{
- if (self.inAppBrowserViewController != nil) {
- [self.inAppBrowserViewController close];
- self.inAppBrowserViewController = nil;
- }
-
- self.callbackId = nil;
+ // Things are cleaned up in browserExit.
+ [self.inAppBrowserViewController close];
}
- (BOOL) isSystemUrl:(NSURL*)url
@@ -372,14 +368,15 @@
if (self.callbackId != nil) {
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsDictionary:@{@"type":@"exit"}];
- [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
-
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+ self.callbackId = nil;
}
+ // Set navigationDelegate to nil to ensure no callbacks are received from it.
+ self.inAppBrowserViewController.navigationDelegate = nil;
// Don't recycle the ViewController since it may be consuming a lot of memory.
// Also - this is required for the PDF/User-Agent bug work-around.
self.inAppBrowserViewController = nil;
-
+
if (IsAtLeastiOSVersion(@"7.0")) {
[[UIApplication sharedApplication] setStatusBarStyle:_previousStatusBarStyle];
}