-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[WiP] Fix leak on Command Element #26044
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
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.
The build is failing because there are some unit tests not passing:
Failed ReenabledAfterCommandRemoved [< 1 ms]
Error Message:
Assert.True() Failure
Expected: True
Actual: False
Failed RemovedCommandEnablesRefreshView [< 1 ms]
Error Message:
Assert.True() Failure
Expected: True
Actual: False
Could you review it? Let me know if can help with something.
8c68bb0
to
ecb9dd6
Compare
ve.Unloaded -= OnUnloaded; | ||
ve.Unloaded += OnUnloaded; |
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.
What is the idea behind this?
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.
safe code to avoid the same control to subscribe the same event more than once. But this will be reworked, this approach will not be used
Azure Pipelines successfully started running 3 pipeline(s). |
Closing in favor of #29837 29837 |
Description of Change
This PRs make sure that controls that implements
ICommandElement
unsubscribe fromCommand.CanExecuteChanged
event avoid the control to leak if theCommand
lives longer than it.Issues Fixed
Fixes #16124