diff --git a/Destination.cpp b/Destination.cpp index 2ebf0fbb..3534598f 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -102,7 +102,7 @@ namespace stream { std::unique_lock 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; } } } diff --git a/Streaming.cpp b/Streaming.cpp index 65796ba0..a14cd084 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -201,6 +201,7 @@ namespace stream m_IsReset = true; m_ReceiveTimer.cancel (); m_ResendTimer.cancel (); + m_AckSendTimer.cancel (); } }