Open jhong70 opened 1 year ago
Hi @jhong70, thank you for opening this PR! Can you provide some more specifics on between which two objects you're seeing a retain cycle as well as steps for how we can replicate this leak?
@scannillo I recently fixed a memory leak in my project for webView.configuration.userContentController.add
, which retains the handler. It was very difficult to debug.
Summary of changes
There are various points in POPPopupBridge.swift where self is captured and retained. This causes POPPopupBridge and web views to leak. This change addresses those issues by passing in self as weak reference. Additionally we prevent leaks from using WKScriptMessageHandler by creating a proxy object that weekly retains the handler.
Checklist
[x] Added a changelog entry
Authors