Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/cascadia/WindowsTerminal/IslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,15 @@ void IslandWindow::Close()
// WinUI will strongly hold onto the first DesktopWindowXamlSource that is created.
// If we don't manually set the Content() to null first, closing that first window
// will leak all of its contents permanently.
_source.Content(nullptr);
//
// However, sometimes resetting the content during showdown throws an exception.
// We want to continue shutting down, even if this failed (and just leak the
// content if that's what it is going to do.)
try
{
_source.Content(nullptr);
}
CATCH_LOG();

_source.Close();
_source = nullptr;
Expand Down
Loading