mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-11-11 11:27:37 +00:00
reference counter for destinations
This commit is contained in:
1 parent
1b97f9b6c9
commit
c287fb58bd
5 files changed
+19
-3
No files matched your search
@@ -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 ();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user