RESOLVED FIXED 53100
WK2 leaks when a page is closed
https://bugs.webkit.org/show_bug.cgi?id=53100
Summary WK2 leaks when a page is closed
chris fleizach
Reported 2011-01-25 10:45:32 PST
It looks like the remote accessibility element holds strong references to the window object. To remedy, WKView should release those references when the page closes.
Attachments
Patch (4.27 KB, patch)
2011-01-25 11:00 PST, chris fleizach
sam: review-
Patch (5.35 KB, patch)
2011-01-25 11:41 PST, chris fleizach
no flags
Patch (6.77 KB, patch)
2011-01-25 13:12 PST, chris fleizach
no flags
Patch (7.08 KB, patch)
2011-01-25 14:39 PST, chris fleizach
cfleizach: review-
cfleizach: commit-queue-
mitz
Comment 1 2011-01-25 10:48:16 PST
chris fleizach
Comment 2 2011-01-25 11:00:39 PST
Build Bot
Comment 3 2011-01-25 11:31:07 PST
chris fleizach
Comment 4 2011-01-25 11:41:39 PST
Early Warning System Bot
Comment 5 2011-01-25 11:43:28 PST
Sam Weinig
Comment 6 2011-01-25 11:50:35 PST
Comment on attachment 80084 [details] Patch This needs to stub out pageClosed in the other PageClients (win/WebView.h, API/qt/qwkpage_p.h). We may also want to do this when the process crashes.
Early Warning System Bot
Comment 7 2011-01-25 12:00:47 PST
Darin Adler
Comment 8 2011-01-25 12:01:41 PST
Comment on attachment 80088 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=80088&action=review Please don’t break the Qt build, otherwise looks good. > Source/WebKit2/UIProcess/API/mac/WKView.mm:1405 > + WKAXInitializeRemoteElementWithWindow(_data->_remoteAccessibilityChild.get(), nil); The use of initialize in the name of this function makes it surprising that you can use it to clear the window. Perhaps it should be called WKAXSetWindowForRemoteElement? > Source/WebKit2/UIProcess/win/WebView.cpp:631 > +void WebView::pageClosed() > +{ > +} I think you’ll need this for Qt too, in UIProcess/API/qt/qwkpage.cpp.
chris fleizach
Comment 9 2011-01-25 12:44:56 PST
> The use of initialize in the name of this function makes it surprising that you can use it to clear the window. Perhaps it should be called WKAXSetWindowForRemoteElement? > file https://bugs.webkit.org/show_bug.cgi?id=53118 to handle the rename
Anders Carlsson
Comment 10 2011-01-25 12:52:21 PST
(In reply to comment #9) > > The use of initialize in the name of this function makes it surprising that you can use it to clear the window. Perhaps it should be called WKAXSetWindowForRemoteElement? > > > > file https://bugs.webkit.org/show_bug.cgi?id=53118 to handle the rename Instead of doing this in close, could we do it in viewDidMoveToWindow when the new window is nil? That way you wouldn't always leak the WKView unless you explicitly call close.
chris fleizach
Comment 11 2011-01-25 12:56:30 PST
(In reply to comment #10) > (In reply to comment #9) > > > The use of initialize in the name of this function makes it surprising that you can use it to clear the window. Perhaps it should be called WKAXSetWindowForRemoteElement? > > > > > > > file https://bugs.webkit.org/show_bug.cgi?id=53118 to handle the rename > > Instead of doing this in close, could we do it in viewDidMoveToWindow when the new window is nil? > > That way you wouldn't always leak the WKView unless you explicitly call close. It looks like viewDidMoveToWindow is not called when the window is closed
chris fleizach
Comment 12 2011-01-25 13:12:25 PST
Darin Adler
Comment 13 2011-01-25 14:03:29 PST
Comment on attachment 80110 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=80110&action=review This patch failed to apply because of a merge conflict, so we are not getting EWS results for it. You probably should merge and post a new patch so we can see if it breaks the build or not. > Source/WebKit2/UIProcess/API/mac/WKView.mm:1412 > + [self _setRemoteAccessibilityWindow:nil]; We may want to do this in viewDidMoveToWindow as well, as Anders suggested, even though we can’t do it only there.
chris fleizach
Comment 14 2011-01-25 14:39:57 PST
chris fleizach
Comment 15 2011-01-25 14:42:01 PST
adding patch to see if it builds on qt
chris fleizach
Comment 16 2011-01-25 17:54:26 PST
chris fleizach
Comment 17 2011-01-25 17:55:02 PST
Comment on attachment 80126 [details] Patch already reviewed by darin
Note You need to log in before you can comment on or make changes to this bug.