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

(1.9 port) Fix a number of shutdown crashes in TermControl #10117

Merged
merged 1 commit into from
May 18, 2021

Conversation

DHowett
Copy link
Member

@DHowett DHowett commented May 17, 2021

  1. The TSFInputControl may get a layout event after it has been removed
    from service (and no longer has a XAML tree)
    • Two fixes:
      • first, guard the layour updater from accessing detached xaml
        objects
      • second, shut down all pending throttled functions during close
        (not destruction!¹)
  2. The TermControlAutomationPeer may be destructed before its events
    fire.
  3. The TermControlAutomationPeer may receive a notification after it has
    been detached from XAML (and therefore has no dispatcher).

¹ Close happens before the control is removed from the XAML tree;
destruction happens some time later. We must detach all UI-bound events
in Close so that they don't fire between when we detach and when we
destruct.

Fixes MSFT-32496693
Fixes MSFT-32496158
Fixes MSFT-32509759
Fixes MSFT-32871913

(cherry picked from commit 661fde5)

1. The TSFInputControl may get a layout event after it has been removed
   from service (and no longer has a XAML tree)
   * Two fixes:
      * first, guard the layour updater from accessing detached xaml
	objects
      * second, shut down all pending throttled functions during close
	(not destruction!¹)
2. The TermControlAutomationPeer may be destructed before its events
   fire.
3. The TermControlAutomationPeer may receive a notification after it has
   been detached from XAML (and therefore has no dispatcher).

¹ Close happens before the control is removed from the XAML tree;
destruction happens some time later. We must detach all UI-bound events
in Close so that they don't fire between when we detach and when we
destruct.

Fixes MSFT-32496693
Fixes MSFT-32496158
Fixes MSFT-32509759
Fixes MSFT-32871913

(cherry picked from commit 661fde5)
@DHowett DHowett requested a review from zadjii-msft May 17, 2021 21:16
@DHowett DHowett requested a review from lhecker May 18, 2021 22:35
@DHowett
Copy link
Member Author

DHowett commented May 18, 2021

These changes were largely reviewed already, so I'm going to mark this one for inclusion. Thanks!

@DHowett DHowett merged commit 3a27386 into main May 18, 2021
@DHowett DHowett deleted the dev/duhowett/1.9-stab branch May 18, 2021 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants