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

Delete listener when its events map is empty. #2724

Closed

Conversation

henrahmagix
Copy link

Previously a listener only gets deleted based on parameters passed to
stopListening, whereas it should get deleted if it doesn't have any events in
its _events map.

Fixes #2619

Previously a listener only gets deleted based on parameters passed
to stopListening, whereas it should get deleted if it doesn't have
any events in its _events map.
@akre54
Copy link
Collaborator

akre54 commented Aug 17, 2013

Needs the callback fix from #2619 but otherwise LGTM 👍

Previously callback was being changed without checking its value,
which would result in improper event unbinding.
@henrahmagix
Copy link
Author

@akre54 callback fix applied after conversation in #2619 =)

jashkenas added a commit that referenced this pull request Sep 11, 2013
@jashkenas
Copy link
Owner

Huh. I've added the test case from this PR, but it's currently passing for me. Either this change isn't needed, or a better test case is.

@jashkenas jashkenas closed this Sep 11, 2013
@caseywebdev
Copy link
Collaborator

@jashkenas it's because _listeners is now _listeningTo. In fact, all of the _listeners tests are now invalid.

@jashkenas jashkenas reopened this Sep 11, 2013
jashkenas added a commit that referenced this pull request Sep 11, 2013
@jashkenas jashkenas closed this in c198270 Sep 11, 2013
@henrahmagix
Copy link
Author

👍

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.

Memory leak in _listeners with #stopListening implementation
4 participants