Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when there are SVG elements with foreignObject elements #656

Open
eturpin opened this issue Aug 17, 2021 · 0 comments
Open

Memory leak when there are SVG elements with foreignObject elements #656

eturpin opened this issue Aug 17, 2021 · 0 comments

Comments

@eturpin
Copy link

eturpin commented Aug 17, 2021

There seems to be a memory leak that occurs when SVG elements are nested inside foreignObject elements. A "garbage collector" was created to fix #241, but I don't think SVG elements within foreignObject elements will ever be removed from the hub object. foreignObjects will not have a ownerSVGElement property defined, so the delete hub[key]; line will never be executed in the garbage collector.

Would replacing this line in the garbage collector:

if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement))

with

if (!node.isConnected)

be a suitable solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant