StreamLogger#BindStream(): set #m_FlushLogTimer only if needed

refs #6737
This commit is contained in:
Alexander A. Klimov 2019-04-18 12:23:50 +02:00 committed by Michael Friedrich
parent ccbe9f7fbe
commit 622f684124

View File

@ -55,10 +55,12 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
m_Stream = stream; m_Stream = stream;
m_OwnsStream = ownsStream; m_OwnsStream = ownsStream;
m_FlushLogTimer = new Timer(); if (!m_FlushLogTimer) {
m_FlushLogTimer->SetInterval(1); m_FlushLogTimer = new Timer();
m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this)); m_FlushLogTimer->SetInterval(1);
m_FlushLogTimer->Start(); m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this));
m_FlushLogTimer->Start();
}
} }
/** /**