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

Remove handlers (rather than setting to {}) in eachUnbind #345

Merged
merged 2 commits into from
Apr 8, 2022

Conversation

mwoenker
Copy link
Contributor

Currently when unbinding specific keys, the entry in _handlers is never removed, but replaced with an empty object. This leaks a small amount of memory, as well as causing all future unbind() calls and event dispatches for that key to have to search through this growing list of cleared handlers.

This change removes the unbound entries from the list.

@jaywcjlove
Copy link
Owner

@mwoenker thx!

@jaywcjlove jaywcjlove merged commit 1b34ff3 into jaywcjlove:master Apr 8, 2022
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