fix(controls): Resolve ContentDialog ShowAsync task hanging issue#1615
Closed
apachezy wants to merge 2 commits intolepoco:mainfrom
Closed
fix(controls): Resolve ContentDialog ShowAsync task hanging issue#1615apachezy wants to merge 2 commits intolepoco:mainfrom
apachezy wants to merge 2 commits intolepoco:mainfrom
Conversation
- Fixed dialog task hanging by handling Unloaded event to complete pending async operations when dialog is removed. - Added `_capturedDialogHost` field to cache DialogHost value at opening, preventing race conditions from external modifications during display. - Documented that DialogHost must be set before calling ShowAsync.
7 tasks
Contributor
Author
|
To avoid conflicts with other PRs, I have merged the changes and will close this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Opening a new ContentDialog before the previous one is closed causes task hanging—the
ShowAsyncmethod never returns.Typical scenario: Navigation between dialogs.
The
DialogHostproperty is publicly writable; if modified while a dialog is displayed, it leads to inconsistent state.Example of a problem:
ShowAsync-NoResult.mp4
Issue Number: N/A
What is the new behavior?
Handle Unloaded event to complete pending async tasks when dialog is removed
Add
_capturedDialogHostfield to ensure DialogHost consistency during displayUpdate documentation for DialogHost property usage
Fixed [Critical] ContentDialog causes memory leaks when ShowAsync task hangs #1618
After the issue was fixed:
ShowAsync-Fixed.mp4
Other information