Cleared buffer on send instead of write #4721

This commit is contained in:
Jerry (Xinyu Hou) 2015-06-03 14:45:47 -07:00
parent c4e8dc7198
commit 7614a21aac
1 changed files with 3 additions and 7 deletions

View File

@ -95,13 +95,6 @@ IpcLogOutputter::show(bool showIfEmpty)
bool bool
IpcLogOutputter::write(ELevel, const char* text) IpcLogOutputter::write(ELevel, const char* text)
{ {
if (!m_ipcServer.hasClients(kIpcClientGui)) {
if (!m_buffer.empty()) {
m_buffer.clear();
}
return true;
}
// ignore events from the buffer thread (would cause recursion). // ignore events from the buffer thread (would cause recursion).
if (m_bufferThread != nullptr && if (m_bufferThread != nullptr &&
Thread::getCurrentThread().getID() == m_bufferThreadId) { Thread::getCurrentThread().getID() == m_bufferThreadId) {
@ -192,6 +185,9 @@ void
IpcLogOutputter::sendBuffer() IpcLogOutputter::sendBuffer()
{ {
if (m_buffer.empty() || !m_ipcServer.hasClients(kIpcClientGui)) { if (m_buffer.empty() || !m_ipcServer.hasClients(kIpcClientGui)) {
if (!m_buffer.empty()) {
m_buffer.clear();
}
return; return;
} }