Browse Source

delete stream in destination's thread

pull/102/head
orignal 10 years ago
parent
commit
c92d99718b
  1. 7
      Destination.cpp
  2. 1
      Streaming.cpp

7
Destination.cpp

@ -102,7 +102,7 @@ namespace stream @@ -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 @@ -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;
}
}
}

1
Streaming.cpp

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

Loading…
Cancel
Save