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 in Transform #1872

Closed
MariaMikhnevich opened this issue Jan 9, 2025 · 2 comments
Closed

Memory Leak in Transform #1872

MariaMikhnevich opened this issue Jan 9, 2025 · 2 comments

Comments

@MariaMikhnevich
Copy link

In Transform, in the tr.nodes (setNodes) method, one of the subscriptions depends on the private property _mattersAffectingSize. Node has the value of this property equal to [], and only some elements of the array have values.

image

image

Upon tr.detach(), subscriptions are unsubscribed only with the value. But due to the fact that our _attrsAffectingSize property has the value [], the map does not start and the additionalEvents variable is assigned the value ". Accordingly, when using tr.destroy(), this subscription is not unsubscribed, and if we create another transformer and add the same element to nodes, and then call tr.destroy(), the number of subscriptions in the element increases.
Screenshot from 2025-01-09 15-54-45

image

image

image

If you set the _attrsAffectingSize property in Node to ["] instead of [], subscriptions and unsubscriptions start working correctly.
image
image

@lavrton
Copy link
Member

lavrton commented Jan 9, 2025

Do you want to create a Pull Request with the tests and fix?

@MariaMikhnevich
Copy link
Author

MariaMikhnevich commented Jan 9, 2025

Thanks for the answer! Sorry, I'm not good at tests. But I can create a Pull Request without tests. Do it?

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

2 participants