Theoretical fix for some crashes (#15457)

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.
This commit is contained in:
Mike Griese 2023-05-26 14:31:21 -05:00 committed by GitHub
parent a19d30a25a
commit 8611d901b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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();