delete stream in destination's thread

This commit is contained in:
orignal 2014-10-15 10:34:28 -04:00
parent 03914b4f41
commit c92d99718b
2 changed files with 6 additions and 2 deletions

View file

@ -102,7 +102,7 @@ namespace stream
{
std::unique_lock<std::mutex> l(m_StreamsMutex);
for (auto it: m_Streams)
delete it.second;
delete it.second;
m_Streams.clear ();
}
if (m_Pool)
@ -186,7 +186,10 @@ namespace stream
if (it != m_Streams.end ())
{
m_Streams.erase (it);
delete stream;
if (m_Service)
m_Service->post ([stream](void) { delete stream; });
else
delete stream;
}
}
}

View file

@ -201,6 +201,7 @@ namespace stream
m_IsReset = true;
m_ReceiveTimer.cancel ();
m_ResendTimer.cancel ();
m_AckSendTimer.cancel ();
}
}