You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This matters because if we don't call WebView.onDestroy(), the WebView leaks its WebMessageListener instances. Capacitor's WebMessageListener holds a references to the CapacitorWebView, which holds a reference to the Bridge, which holds a reference to the BridgeFragment.
Expected Behavior
After BridgeFragment.onDestroy(), Capacitor cleans up all resources
Project Reproduction
Please let me know if you require a repro for this.
Additional Information
One can work around this by extending BridgeFragment.onDestroy() and calling bridge.getWebView().destroy() manually.
Thank you for this project!
The text was updated successfully, but these errors were encountered:
Thanks for the issue, but we are removing BridgeFragment on Capacitor 7 since is not something Capacitor apps use.
If you are using it, we would recommend to just copy the BridgeFragment class into your project or inside a plugin and use that one instead of the one inside Capacitor as it will go away, and then apply any changes you need like calling WebView.destroy().
I've verified that BridgeFragment doesn't use any Capacitor's private or protected attributes/classes, so can be recreated outside of Capacitor if needed.
No, CAPBridgeViewController is used by all Capacitor iOS apps, is the BridgeActivity equivalent.
For iOS we already removed CAPWebView class in Capacitor 6, which was sort of the BridgeFragment equivalent.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Capacitor Version
[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted.
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 6.1.1
@capacitor/core: 6.1.1
@capacitor/android: 6.1.1
@capacitor/ios: 6.1.1
Installed Dependencies:
@capacitor/cli: 6.1.1
@capacitor/ios: 6.1.1
@capacitor/android: 6.1.1
@capacitor/core: 6.1.1
[success] iOS looking great! 👌
[success] Android looking great! 👌
Other API Details
Platforms Affected
Current Behavior
BridgeFragment.onDestroy()
callsBridge.onDestroy()
, butBridge.onDestroy()
does not callWebView.destroy()
.This matters because if we don't call
WebView.onDestroy()
, theWebView
leaks itsWebMessageListener
instances. Capacitor'sWebMessageListener
holds a references to theCapacitorWebView
, which holds a reference to theBridge
, which holds a reference to theBridgeFragment
.Expected Behavior
After
BridgeFragment.onDestroy()
, Capacitor cleans up all resourcesProject Reproduction
Please let me know if you require a repro for this.
Additional Information
One can work around this by extending
BridgeFragment.onDestroy()
and callingbridge.getWebView().destroy()
manually.Thank you for this project!
The text was updated successfully, but these errors were encountered: