From c92d99718b60a4322c50ad38fb17ebb21ad1b8ef Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 15 Oct 2014 10:34:28 -0400 Subject: [PATCH] delete stream in destination's thread --- Destination.cpp | 7 +++++-- Streaming.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) 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 (); } }