[Webkit-unassigned] [Bug 231659] New: removeAllScriptMessageHandlers causes retain where removeScriptMessageHandlerForName does not

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 13 00:19:26 PDT 2021


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

            Bug ID: 231659
           Summary: removeAllScriptMessageHandlers causes retain where
                    removeScriptMessageHandlerForName  does not
           Product: WebKit
           Version: Safari 15
          Hardware: Mac (Intel)
                OS: macOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: peter at stairways.com.au

In my WKWebView controller, I use:

        [i_webView.configuration.userContentController addScriptMessageHandler:self name:@"KeyboardMaestro"];

This creates a reference to the controller (self). The controller will not be dealloc'ed when the window is closed.

If in the willClose method I do:

                [strongSelf1->i_webView.configuration.userContentController removeScriptMessageHandlerForName:@"KeyboardMaestro"];

The controller will dealloc normally.

However, if I instead fo:


                [strongSelf1->i_webView.configuration.userContentController removeAllScriptMessageHandlers];

The controller does not dealloc, so a reference is retained.

Since removeAllScriptMessageHandlers should cover the case of removeScriptMessageHandlerForName:@"KeyboardMaestro" and more, this seems to be a bug.

-- 
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/20211013/4cf4da7c/attachment.htm>


More information about the webkit-unassigned mailing list