RESOLVED DUPLICATE of bug 228271 231659
removeAllScriptMessageHandlers causes retain where removeScriptMessageHandlerForName does not
https://bugs.webkit.org/show_bug.cgi?id=231659
Summary removeAllScriptMessageHandlers causes retain where removeScriptMessageHandler...
Peter N Lewis
Reported 2021-10-13 00:19:26 PDT
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.
Attachments
Radar WebKit Bug Importer
Comment 1 2021-10-20 00:20:18 PDT
Alex Christensen
Comment 2 2021-10-20 08:06:08 PDT
*** This bug has been marked as a duplicate of bug 228271 ***
Note You need to log in before you can comment on or make changes to this bug.