apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 986 forks source link

fix: WKWebView leak in the platform centered approach #1497

Closed msmtamburro closed 1 month ago

msmtamburro commented 1 month ago

Platforms affected

iOS

Motivation and Context

Addresses #1486

Description

Simply clears the _webViewEngine stored property in this class on ‘dispose’ so that it no longer retains a reference to the WKWebView after dispose.

Testing

In the platform centered approach (e.g, adding cordova-ios to an otherwise native app) via a swift package, we can subclass CDVViewController and dispose all plugins when our ViewController is no longer in the view hierarchy.

Checklist

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.86%. Comparing base (2f0e19e) to head (9ceadf4).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1497 +/- ## ======================================= Coverage 80.86% 80.86% ======================================= Files 16 16 Lines 1840 1840 ======================================= Hits 1488 1488 Misses 352 352 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.