Event listeners added to window removed on destroy#1123
Open
johnkeisuke wants to merge 1 commit intotabalinas:masterfrom
Open
Event listeners added to window removed on destroy#1123johnkeisuke wants to merge 1 commit intotabalinas:masterfrom
johnkeisuke wants to merge 1 commit intotabalinas:masterfrom
Conversation
|
What is the use case for this change? |
Author
|
Using ajax to load data from server. In my case I was managing groups of users, displayed in tables. These groups could be deleted or created several times throughout the day and the event listeners were being accumulated. It is a small memory leak, but it is. |
|
Merge this because it's a memory leak fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1122
I added a unique ID to each table created to be able to detach its listeners easily. The IDs are recycable in order to not increment endlessly the value last ID.