mirror of
https://github.com/microsoft/terminal.git
synced 2026-02-04 01:04:40 +00:00
Close the TermControl when closing a TerminalPaneContent (#19657)
This fixes an issue where calling close on a tab/pane won't raise a StateChange notification on the connection.
This commit is contained in:
@@ -66,8 +66,12 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
void TerminalPaneContent::Close()
|
||||
{
|
||||
// We deliberately remove the event handlers before closing the control.
|
||||
// This is to prevent reentrancy issues, pointless callbacks, etc.
|
||||
_removeControlEvents();
|
||||
|
||||
_control.Close();
|
||||
|
||||
// Clear out our media player callbacks, and stop any playing media. This
|
||||
// will prevent the callback from being triggered after we've closed, and
|
||||
// also make sure that our sound stops when we're closed.
|
||||
|
||||
Reference in New Issue
Block a user