From 217ddfe98d9c523962586740b4d5d87d4eef7a08 Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 23 Mar 2015 13:08:04 -0400 Subject: [PATCH] fixed crash --- Streaming.cpp | 19 +++++++++++-------- Streaming.h | 3 ++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Streaming.cpp b/Streaming.cpp index e91e5f40..28ea7557 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -596,17 +596,20 @@ namespace stream LogPrint (eLogInfo, "All leases are expired. Trying to request"); m_RemoteLeaseSet = nullptr; m_LocalDestination.GetOwner ().RequestDestination (m_RemoteIdentity.GetIdentHash (), - [packets, this](bool success) - { - if (success) - { - LogPrint (eLogInfo, "New LeaseSet found. Sending packets"); - SendPackets (packets); - } - }); + std::bind (&Stream::HandleLeaseSetRequestComplete, shared_from_this (), + std::placeholders::_1, packets)); } } + void Stream::HandleLeaseSetRequestComplete (bool success, std::vector packets) + { + if (success) + { + LogPrint (eLogInfo, "New LeaseSet found. Sending packets"); + SendPackets (packets); + } + } + void Stream::ScheduleResend () { m_ResendTimer.cancel (); diff --git a/Streaming.h b/Streaming.h index 1ba01ea0..12a674bc 100644 --- a/Streaming.h +++ b/Streaming.h @@ -147,7 +147,8 @@ namespace stream template void HandleReceiveTimer (const boost::system::error_code& ecode, const Buffer& buffer, ReceiveHandler handler); - + void HandleLeaseSetRequestComplete (bool success, std::vector packets); + void ScheduleResend (); void HandleResendTimer (const boost::system::error_code& ecode); void HandleAckSendTimer (const boost::system::error_code& ecode);