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

macOS: Prevent crash with popups #17218

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Conversation

grokys
Copy link
Member

@grokys grokys commented Oct 8, 2024

What does the pull request do?

Avalonia started crashing on certain versions of macOS after #16365 when showing popups. This is strange because that PR doesn't actually change anything to do with popups. After debugging the issue on macOS 12 (I couldn't get it to repro with any more recent versions of macOS) I discovered that it was due to this field not being initialized.

I've tried to make xcode detect places where we don't zero-initialize C++ fields to prevent this problem in other places, but I've failed to do so. Passing -Wmissing-field-initializers has no effect and xcode's C++ analyzer doesn't catch this problem either.

Given that this seems to be a problem that C++ can't warn for, I'm opening a PR with this fix and we'll keep our fingers crossed that we have remembered to initialize all other fields, and will remember to do so in future. If there's anyone out there who's better at C++ on macOS than me and who can manage to get it producing a warning for uninitialized fields: a PR would be appreciated.

Fixed issues

Fixes #17018

@grokys grokys added bug os-macos customer-priority Issue reported by a customer with a support agreement. backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Oct 8, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052489-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 merged commit cb4b698 into master Oct 8, 2024
12 checks passed
@maxkatz6 maxkatz6 deleted the fixes/17018-tooltip-crash branch October 8, 2024 21:14
maxkatz6 pushed a commit that referenced this pull request Oct 27, 2024
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported-11.2.x bug customer-priority Issue reported by a customer with a support agreement. os-macos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tooltip Causes App Crash on macOS in Avalonia 11.2.0-beta1
4 participants