-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Event.removeEventListener removes listeners incorrectly #5827
Comments
Why is this happening?
Possible Solutions:
Either solution is trivial, and I'm happy to make a PR, but I'm not sure which one would be preferred. It seems like it comes down to a choice between sorting or searching (though either of these operations would only occur when there are listeners pending to be removed, which only happens if removeEventListener is called while an event is actively being raised—so the performance implications should be negligible either way). Please advise on which solution is better (if any), and I will submit a PR. |
Thanks for investigating this @speigg ! I think Solution # 1 would probably be the fix with the smallest impact, but I'm sure you will get more opinions when you actually open you PR. 😏 |
Fixed removing multiple listeners within event callbacks #5827
Fixed in #5833 |
Congratulations on closing the issue! I found these Cesium forum links in the comments above: https://groups.google.com/forum/#!searchin/cesium-dev/dynamic$20grid$20lines%7Csort If this issue affects any of these threads, please post a comment like the following:
I am a bot who helps you make Cesium awesome! Thanks again. |
When removing multiple listeners from an instance of
Event
, while the event is being raised, the listeners are not removed correctly.See:
Outputs the following (as expected):
But when calling
e.raiseEvent()
again, we see:instead of the expected:
The text was updated successfully, but these errors were encountered: