[Webkit-unassigned] [Bug 215158] ResizeObserver appears to not be properly garbage collected

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 18 18:48:08 PDT 2020


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

--- Comment #8 from Clark Pan <clark.y.pan at gmail.com> ---
The number of ResizeObserver is not the issue per se; the real issue is what is leaked via the functions scopes of the passed in handler. In a single page app environment, any visual component that wants to use ResizeObserver will be leaking its entire DOM tree when the component is removed.

I've worked around this issue in our codebase by providing a proxy implement for ResizeObserver, which nulls out the handler when I remove the component in question. It would be nice to not need this hack though, since it requires developers to know to call `disconnect` when the ResizeObserver is no longer used (which is not strictly needed, since if you have matching observe/unobserve calls, it should be sufficient based on the spec).

-- 
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/20201019/8e82b16e/attachment.htm>


More information about the webkit-unassigned mailing list