Navigation Menu

Skip to content

Commit

Permalink
#5660: Fix ConsoleView taking ages to catch up with adding buffered l…
Browse files Browse the repository at this point in the history
…og lines to the text control.
  • Loading branch information
codereader committed Jul 2, 2021
1 parent e2bd362 commit b453c89
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions libs/wxutil/ConsoleView.cpp
Expand Up @@ -47,8 +47,17 @@ void ConsoleView::flushLine()
{
std::lock_guard<std::mutex> lock(_lineBufferMutex);

_lineBuffer.emplace_back(_bufferMode, std::string());
_lineBuffer.back().second.swap(_buffer);
// If the mode didn't change, put it on the pile
if (!_lineBuffer.empty() && _lineBuffer.back().first == _bufferMode)
{
_lineBuffer.back().second.append(_buffer);
}
else
{
_lineBuffer.emplace_back(_bufferMode, std::move(_buffer));
}

_buffer = std::string();
}
}

Expand Down

0 comments on commit b453c89

Please sign in to comment.