Skip to content

Commit

Permalink
Theoretical fix for some crashes (#15457)
Browse files Browse the repository at this point in the history
RE:
* #15454
* MSFT:44725712 "WindowsTerminal.exe!NonClientIslandWindow::OnSize"
* MSFT:44754014 "NonClientIslandWindow::GetTotalNonClientExclusiveSize"

I think this should fix all of those, but I want to ship and verify
live, since I can't repro this locally.

(cherry picked from commit 8611d90)
Service-Card-Id: 89337669
Service-Version: 1.18
  • Loading branch information
zadjii-msft authored and DHowett committed May 26, 2023
1 parent e1e3acf commit 910cfe0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cascadia/WindowsTerminal/IslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ void IslandWindow::Close()
// </BODGY>
}

// GH#15454: Unset the user data for the window. This will prevent future
// callbacks that come onto our window message loop from being sent to the
// IslandWindow (or other derived class's) implementation.
//
// Specifically, this prevents a pending coroutine from being able to call
// something like ShowWindow, and have that come back on the IslandWindow
// message loop, where it'll end up asking XAML something that XAML is no
// longer able to answer.
SetWindowLongPtr(_window.get(), GWLP_USERDATA, 0);

if (_source)
{
_source.Close();
Expand Down

0 comments on commit 910cfe0

Please sign in to comment.