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 app shutdown cancellation via window #15438

Merged
merged 2 commits into from
Apr 20, 2024

Conversation

maxkatz6
Copy link
Member

What does the pull request do?

App shutdown method is supposed to be cancelled, if at least one window did cancel this event.
When at least one window is cancelled, TryShutdown was returning false as expected. Unfortunately, dispatcher was still killed in the same method in finalizer that was always executing.

Checklist

Fixed issues

Fixes #14748

@maxkatz6 maxkatz6 added bug backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 19, 2024
@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 merged commit 8500621 into master Apr 20, 2024
11 checks passed
@maxkatz6 maxkatz6 deleted the fix-shutdown-cancellation-via-window branch April 20, 2024 00:16
maxkatz6 added a commit that referenced this pull request Apr 20, 2024
* Don't call dispatcher shutdown, when app shutdown was cancelled

* Assert Dispatcher.UIThread.ShutdownStarted in TryShutdown_Cancellable_By_Preventing_Window_Close
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 20, 2024
@maxkatz6 maxkatz6 removed the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to cancel App Shutdown from Window Closing
3 participants