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

refs #6737

(cherry picked from commit 622f68412440d4fa3ac1b347a929087073bc24f9)
This commit is contained in:
Alexander A. Klimov 2019-04-18 12:23:50 +02:00 committed by Michael Friedrich
parent 304ba1fd6c
commit f551666a7d

View File

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