mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
StreamLogger#BindStream(): set #m_FlushLogTimer only if needed
refs #6737 (cherry picked from commit 622f68412440d4fa3ac1b347a929087073bc24f9)
This commit is contained in:
parent
304ba1fd6c
commit
f551666a7d
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user