-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 register/unregister issues of WeakReferenceMessenger #4082
Fix register/unregister issues of WeakReferenceMessenger #4082
Conversation
Thanks steinhilber for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding a new test method too!
Just left some very small notes, but looks good overall 🙂
Co-authored-by: Sergio Pedri <sergio0694@live.com>
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
Co-authored-by: Sergio Pedri <sergio0694@live.com>
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-hawker Just a note: this is the same issue you had raised as well while reviewing #3893: without some automated process to either fix the formatting or at least validate that the state is kept consistent, it's really really easy to reintroduce differences in whitespace formatting while making changes (especially because VS sometimes applies these changes automatically) and still end up with the same situation we had before. As in, the changes in #3893 aren't really that easily maintainable in the long term right now without still ending up with some inconsistencies here and there by accident 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks! 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Hello @RosarioPulella! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Fixes #4081
PR Type
What kind of change does this PR introduce?
Bugfix
What is the current behavior?
The attached message handlers of a WeakReferenceMessenger do not get called anymore correctly for all registered objects after unregistering one of them.
What is the new behavior?
The attached message handlers get called for all registered objects.
There was an issue with the enumerator of the ConditionalWeakTable. The linked list nodes were not iterated correctly when a key gets removed while enumerating. In this case the "Next"-property of the node was set to null and the while loop stopped immediately (without checking the remaining nodes).
As a fix the next node is now kept as a locale variable so that it does not get lost when removing the key.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information