Resolves issue 290: InAppBrowser will not destroy WebView after being closed (by invoking ref.close()) causing memory leaks

This commit is contained in:
Damian Tarnawsky 2022-10-12 12:19:02 -07:00
parent 8ee1d38821
commit e899cc3f09

View File

@ -536,6 +536,14 @@ public class InAppBrowser extends CordovaPlugin {
dialog.dismiss();
dialog = null;
}
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