mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
use std::shared_from_this
This commit is contained in:
parent
c68aca4ada
commit
77918fd412
2 changed files with 9 additions and 5 deletions
|
@ -182,7 +182,8 @@ namespace datagram
|
|||
// we used this session
|
||||
m_LastUse = i2p::util::GetMillisecondsSinceEpoch();
|
||||
// schedule send
|
||||
m_LocalDestination->GetService().post(std::bind(&DatagramSession::HandleSend, this, msg));
|
||||
auto self = shared_from_this();
|
||||
m_LocalDestination->GetService().post(std::bind(&DatagramSession::HandleSend, self, msg));
|
||||
}
|
||||
|
||||
DatagramSession::Info DatagramSession::GetSessionInfo() const
|
||||
|
@ -334,7 +335,8 @@ namespace datagram
|
|||
{
|
||||
boost::posix_time::milliseconds dlt(100);
|
||||
m_SendQueueTimer.expires_from_now(dlt);
|
||||
m_SendQueueTimer.async_wait([this](const boost::system::error_code & ec) { if(ec) return; FlushSendQueue(); });
|
||||
auto self = shared_from_this();
|
||||
m_SendQueueTimer.async_wait([self](const boost::system::error_code & ec) { if(ec) return; self->FlushSendQueue(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue