[Webkit-unassigned] [Bug 237652] New: WKUserContentController.add(_:name:) leads to memory leak even if wrap the object into a weak reference wrapper

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 9 06:01:00 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=237652

            Bug ID: 237652
           Summary: WKUserContentController.add(_:name:) leads to memory
                    leak even if wrap the object into a weak reference
                    wrapper
           Product: WebKit
           Version: Safari 15
          Hardware: All
                OS: iOS 15
            Status: NEW
          Severity: Major
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: dh.chong at outlook.com

>From our developer side, adding user script will unexpectedly leak the WKUserScript object even if the WKWebView instance is deallocated.

Proof: https://twitter.com/WildCat_io/status/1501547346416799746

Workaround of this bug: To remove all message handlers when the WKWebView is deallocated: https://github.com/Lakr233/XTerminalUI/blob/3204296353e8874020c834cc70343f73ad4ecdf9/Sources%2FXTerminalUI%2FXTerminalWebViewDelegate.swift#L26 (It can also be put into WKWebView.deinit).

It can be reproduced on both iOS 15 and macOS 12 (catalyst).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220309/2aae359a/attachment.htm>


More information about the webkit-unassigned mailing list