Skip to content

Commit

Permalink
Fix TerminalPage not being released on window close (#17107)
Browse files Browse the repository at this point in the history
Because this holds onto the root element, `TerminalPage` gets "leaked"
on Windows 10 when a window is closed until another is opened.

## Validation Steps Performed
* Set a breakpoint in `Renderer::~Renderer`
* Open and close a window
* Breakpoint used to not get hit and now it does ✅

(cherry picked from commit a590a1b)
Service-Card-Id: 92407667
Service-Version: 1.20
  • Loading branch information
lhecker authored and DHowett committed Apr 23, 2024
1 parent e2a076c commit 8c1316c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ bool NonClientIslandWindow::Initialize()
// - <none>
void NonClientIslandWindow::SetContent(winrt::Windows::UI::Xaml::UIElement content)
{
_clientContent = content;

_rootGrid.Children().Append(content);

// SetRow only works on FrameworkElement's, so cast it to a FWE before
Expand Down
1 change: 0 additions & 1 deletion src/cascadia/WindowsTerminal/NonClientIslandWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class NonClientIslandWindow : public IslandWindow
std::optional<til::point> _oldIslandPos;

winrt::TerminalApp::TitlebarControl _titlebar{ nullptr };
winrt::Windows::UI::Xaml::UIElement _clientContent{ nullptr };

wil::unique_hbrush _backgroundBrush;
til::color _backgroundBrushColor;
Expand Down

0 comments on commit 8c1316c

Please sign in to comment.