try streaming race condition fix

This commit is contained in:
Jeff Becker 2018-01-25 08:49:30 -05:00
parent 0bb0adbf3e
commit f4a2dda94e
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -578,7 +578,9 @@ namespace stream
if (m_SentPackets.empty () && m_SendBuffer.IsEmpty ()) // nothing to send
{
m_Status = eStreamStatusClosed;
SendClose ();
// close could be called from another thread so do SendClose from the destination thread
// this is so m_LocalDestination.NewPacket () does not trigger a race condition
m_Service.post(std::bind(&Stream::SendClose, shared_from_this()));
}
break;
case eStreamStatusClosed: