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

Fix NavigationViewCrash with the attached revokers object pattern during cleanup. #6240

Merged
merged 2 commits into from
Nov 6, 2021

Conversation

StephenLPeters
Copy link
Contributor

Update NavigationView to track which items get a revokers object attached to them and to revoke those during deconstructing. Additionally ensure that the NavigationViewItemRevokers dependency property is only initialized once.

…ched to them and to revoke those during deconstructing. Additionally ensure that the NavigationViewItemRevokers dependency property is only initialized once.
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Nov 4, 2021
@StephenLPeters
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj ranjeshj added area-NavigationView NavView control team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Nov 4, 2021
@ranjeshj ranjeshj requested a review from RBrid November 5, 2021 01:40
Copy link
Contributor

@ranjeshj ranjeshj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ranjeshj ranjeshj requested a review from jevansaks November 5, 2021 01:43
Copy link
Member

@jevansaks jevansaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with suggestions.

nullptr /* defaultValue */);
if (!s_NavigationViewItemRevokersProperty)
{
s_NavigationViewItemRevokersProperty =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-existing issue: this is a multi-threaded race condition. Obviously it's pretty narrow now because you have to have two threads both trying to create a NavView at exactly the same time ... but maybe use std::call_once to synchronize the initialization?

@StephenLPeters
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters StephenLPeters merged commit 3ac8fc1 into main Nov 6, 2021
@StephenLPeters StephenLPeters deleted the user/stpete/NavigationViewItemRevokers branch November 6, 2021 23:11
llongley pushed a commit that referenced this pull request Aug 11, 2022
…ing cleanup. (#6240)

* Update NavigationView to track which items get a revokers object attached to them and to revoke those during deconstructing. Additionally ensure that the NavigationViewItemRevokers dependency property is only initialized once.

* Add an std::call_once block to the DP registration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NavigationView NavView control team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants