Fix possible double free in StreamLogger::BindStream()

refs #6737
This commit is contained in:
Michael Friedrich 2018-11-08 15:51:58 +01:00
parent ec169de5c4
commit 1f5555e1d6
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ StreamLogger::~StreamLogger()
if (m_FlushLogTimer)
m_FlushLogTimer->Stop();
if (m_OwnsStream)
if (m_Stream && m_OwnsStream)
delete m_Stream;
}
@ -66,7 +66,7 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
{
ObjectLock olock(this);
if (m_OwnsStream)
if (m_Stream && m_OwnsStream)
delete m_Stream;
m_Stream = stream;