reference counter for destinations

This commit is contained in:
orignal 2017-07-06 16:12:06 -04:00
parent 1b97f9b6c9
commit c287fb58bd
5 changed files with 19 additions and 3 deletions

View file

@ -921,6 +921,7 @@ namespace client
}
if (localDestination)
{
localDestination->Acquire ();
auto session = std::make_shared<SAMSession>(localDestination);
std::unique_lock<std::mutex> l(m_SessionsMutex);
auto ret = m_Sessions.insert (std::make_pair(id, session));
@ -945,6 +946,7 @@ namespace client
}
if (session)
{
session->localDestination->Release ();
session->localDestination->StopAcceptingStreams ();
session->CloseStreams ();
}