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: XamlRoot may be null when the SKXamlCanvas is unloaded #2854

Merged
merged 4 commits into from
Jun 3, 2024

Conversation

jeromelaban
Copy link
Contributor

Description of Change

Avoids an NRE when using a null XamlRoot on WinUI when the control is unloading.

API Changes

None.

Behavioral Changes

None.

Required skia PR

None.

@jeromelaban
Copy link
Contributor Author

@mattleibow could it be possible to backport this one to 2.88? Thanks!

Copy link

@jdobelstein jdobelstein left a comment

Choose a reason for hiding this comment

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

jeromelaban is a null check in on the root.Invalidate call needed for the same reason? Couldn't hurt.

@jeromelaban
Copy link
Contributor Author

jeromelaban is a null check in on the root.Invalidate call needed for the same reason? Couldn't hurt.

That's fair. I ignored that particular site because the XamlRoot.Changed event is called only when XamlRoot is set, but indeed, it does not hurt.

@mattleibow mattleibow added the backport/release/2.x Backport this PR to release/2.x label Jun 3, 2024
@mattleibow mattleibow merged commit 8e7a51d into mono:main Jun 3, 2024
1 of 2 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 3, 2024
* fix: XamlRoot may be null when the SKXamlCanvas is unloaded

* chore: Adjust more xamlroot uses

---------

Co-authored-by: Matthew Leibowitz <[email protected]>
(cherry picked from commit 8e7a51d)
@jeromelaban jeromelaban deleted the dev/jela/winui-xamlroot branch June 3, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/release/2.x Backport this PR to release/2.x community ✨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants