Fix crash while calling Stream.RemoveStream

This commit is contained in:
badaix 2025-01-19 22:46:24 +01:00
parent 61bda79158
commit 780d8f3f1a
6 changed files with 20 additions and 19 deletions

View file

@ -145,7 +145,8 @@ void ProcessStream::onStderrMsg(const std::string& line)
void ProcessStream::stderrReadLine()
{
const std::string delimiter = "\n";
boost::asio::async_read_until(*stream_stderr_, streambuf_stderr_, delimiter, [this, delimiter](const std::error_code& ec, std::size_t bytes_transferred)
boost::asio::async_read_until(*stream_stderr_, streambuf_stderr_, delimiter,
[this, self = shared_from_this(), delimiter](const std::error_code& ec, std::size_t bytes_transferred)
{
if (ec)
{