delete stream from inside

This commit is contained in:
orignal 2014-12-01 21:26:51 -05:00
parent 38ee813e41
commit 4e54fbec08
7 changed files with 17 additions and 19 deletions

View file

@ -207,6 +207,7 @@ namespace stream
m_IsOpen = false;
m_IsReset = true;
m_ReceiveTimer.cancel ();
m_LocalDestination.DeleteStream (shared_from_this ());
}
}
@ -549,9 +550,11 @@ namespace stream
packets.push_back (it);
else
{
Close ();
LogPrint (eLogWarning, "Packet ", it->GetSeqn (), "was not ACKed after ", MAX_NUM_RESEND_ATTEMPTS, " attempts. Terminate");
m_IsOpen = false;
m_IsReset = true;
m_ReceiveTimer.cancel ();
m_LocalDestination.DeleteStream (shared_from_this ());
return;
}
}
@ -715,11 +718,5 @@ namespace stream
delete uncompressed;
}
}
void DeleteStream (std::shared_ptr<Stream> stream)
{
if (stream)
stream->GetLocalDestination ().DeleteStream (stream);
}
}
}