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

Update use of weak_ref in SwipeControl to avoid potential race condition #1565

Merged
merged 1 commit into from Nov 8, 2019

Conversation

kmahone
Copy link
Member

@kmahone kmahone commented Nov 7, 2019

A speculative fix for: #890

The issue is that we are attempting to resolve a weak ref to a managed object (sub-class of SwipeControl) that has already been garbage collected.

I have never been able to reproduce the crash from #890, so I cannot confirm that this change resolves the issue. But this change removes a potential race condition in SwipeControl. Before checking a weak_ref for equality, we first take a strong ref to ensure that the object does not get destroyed between the time we check the weak ref and the time we use it.

@kmahone kmahone requested a review from a team as a code owner November 7, 2019 23:47
@kmahone kmahone merged commit cf035ad into master Nov 8, 2019
@kmahone kmahone deleted the user/kmahone/swipecontrolweakref branch November 8, 2019 17:15
@jevansaks jevansaks added the release note PR that we want to call out in the next release summary label Nov 19, 2019
@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.3.191121001-prerelease has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release note PR that we want to call out in the next release summary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants