mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
Fix leaking the contents of the first tab in the first window (#18621)
Found this one completely randomly.
## Validation Steps Performed
* Open 2 windows with 1 tab each
* Click the X button on the tab in the 1st window
* OpenConsole/etc. is cleaned up ✅
---------
Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
This commit is contained in:
parent
4bcdd7a844
commit
c7f0d0addb
@ -95,6 +95,12 @@ void IslandWindow::Close()
|
||||
|
||||
if (_source)
|
||||
{
|
||||
// BODGY
|
||||
// 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);
|
||||
|
||||
_source.Close();
|
||||
_source = nullptr;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user