mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
Sanity checks around shared_from_this()
This commit is contained in:
parent
45cda241f0
commit
91a2af0eda
3 changed files with 2 additions and 11 deletions
|
@ -90,6 +90,7 @@ namespace llarp
|
|||
m_RemoteRC = msg->rc;
|
||||
GotLIM = util::memFn(&Session::GotRenegLIM, this);
|
||||
auto self = shared_from_this();
|
||||
assert(self.use_count() > 1);
|
||||
SendOurLIM([self](ILinkSession::DeliveryStatus st) {
|
||||
if (st == ILinkSession::DeliveryStatus::eDeliverySuccess)
|
||||
{
|
||||
|
@ -241,6 +242,7 @@ namespace llarp
|
|||
}
|
||||
}
|
||||
auto self = shared_from_this();
|
||||
assert(self.use_count() > 1);
|
||||
if (m_EncryptNext && !m_EncryptNext->empty())
|
||||
{
|
||||
m_Parent->QueueWork([self, data = std::move(m_EncryptNext)] { self->EncryptWorker(data); });
|
||||
|
|
|
@ -47,12 +47,6 @@ namespace llarp
|
|||
|
||||
~Session() = default;
|
||||
|
||||
std::shared_ptr<ILinkSession>
|
||||
BorrowSelf() override
|
||||
{
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
void
|
||||
Pump() override;
|
||||
|
||||
|
|
|
@ -26,11 +26,6 @@ namespace llarp
|
|||
eDeliveryDropped = 1
|
||||
};
|
||||
|
||||
/// equiv of shared_from_this but for the interface type so
|
||||
/// that each implementation can use shared_from_this
|
||||
virtual std::shared_ptr<ILinkSession>
|
||||
BorrowSelf() = 0;
|
||||
|
||||
/// hook for utp for when we have established a connection
|
||||
virtual void
|
||||
OnLinkEstablished(ILinkLayer*){};
|
||||
|
|
Loading…
Reference in a new issue