Android - Fix for webView window not being destroyed correctly causing memory leak (https://github.com/apache/cordova-plugin-inappbrowser/issues/290)
This commit is contained in:
parent
2fef3046fc
commit
e669dc3144
@ -534,6 +534,16 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
dialog.dismiss();
|
||||
dialog = null;
|
||||
}
|
||||
|
||||
// Fix for webView window not being destroyed correctly causing memory leak
|
||||
// (https://github.com/apache/cordova-plugin-inappbrowser/issues/290)
|
||||
if (url.equals(new String("about:blank"))) {
|
||||
inAppWebView.onPause();
|
||||
inAppWebView.removeAllViews();
|
||||
inAppWebView.destroyDrawingCache();
|
||||
inAppWebView.destroy();
|
||||
inAppWebView = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
// NB: From SDK 19: "If you call methods on WebView from any thread
|
||||
|
Loading…
Reference in New Issue
Block a user