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

Fix memory leaks. #1

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Fix memory leaks. #1

merged 1 commit into from
Jul 8, 2024

Conversation

ribrdb
Copy link

@ribrdb ribrdb commented Jul 2, 2024

  • Remove event handlers from window when the tooltip is not showing.
  • Get rid of component deconstruction remnants.

downgradeElements was updated in dec 2015 to not actually do any downgrading, because at the time none of the components needed deconstruction. A memory leak was then added to the Tooltip component in May 2016.

These changes to downgradeElements were problematic:

  • It still removes the data-upgraded attributes from dom elements, even though no deconstruction actually happened. This means that calling upgradElement again will double-upgrade the element.
  • the createComponents_ array no longer serves any purpose.

 - Remove event handlers from `window` when the tooltip is not showing.
- Get rid of component deconstruction remnants.

`downgradeElements` was updated in dec 2015 to not actually do any downgrading, because at the time none of the components needed deconstruction. A memory leak was then added to the Tooltip component in May 2016.

These changes to `downgradeElements` were problematic:
 - It still removes the `data-upgraded` attributes from dom elements, even though no deconstruction actually happened. This means that calling `upgradElement` again will double-upgrade the element.
 - the `createComponents_` array no longer serves any purpose.
@ribrdb ribrdb merged commit 5c94dd6 into mdl-1.x Jul 8, 2024
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

Successfully merging this pull request may close these issues.

2 participants