mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
Let the output handler hold a ref to the blackbox, not to the recorder
This commit is contained in:
parent
0197d501d9
commit
a76925e20f
@ -132,12 +132,14 @@ ConnectionRecorder::~ConnectionRecorder() noexcept
|
||||
|
||||
void ConnectionRecorder::Connection(const winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection& connection)
|
||||
{
|
||||
_connectionEvents.output = connection.TerminalOutput(winrt::auto_revoke, [this](const winrt::hstring& output) {
|
||||
this->_blackbox->Log(output);
|
||||
_connectionEvents.output = connection.TerminalOutput(winrt::auto_revoke, [blackbox = _blackbox](const winrt::hstring& output) {
|
||||
blackbox->Log(output);
|
||||
});
|
||||
#if 0
|
||||
_connectionEvents.stateChanged = connection.StateChanged(winrt::auto_revoke, [this](auto&&, auto&&) {
|
||||
|
||||
});
|
||||
#endif
|
||||
_connection = connection;
|
||||
}
|
||||
|
||||
|
||||
@ -119,15 +119,15 @@ struct ConnectionRecorder : public winrt::implements<ConnectionRecorder, winrt::
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
bool _started{ false };
|
||||
std::shared_ptr<Blackbox> _blackbox;
|
||||
std::wstring _filePath;
|
||||
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _connection{ nullptr };
|
||||
|
||||
struct
|
||||
{
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection::StateChanged_revoker stateChanged;
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection::TerminalOutput_revoker output;
|
||||
} _connectionEvents;
|
||||
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _connection{ nullptr };
|
||||
|
||||
bool _started{ false };
|
||||
std::shared_ptr<Blackbox> _blackbox;
|
||||
std::wstring _filePath;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user