From 4e4def4fb90f8a0cb1faf61a935479f7527168bf Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Thu, 31 Aug 2017 10:24:07 -0400 Subject: [PATCH] use shared from this --- libi2pd/Destination.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libi2pd/Destination.cpp b/libi2pd/Destination.cpp index a32e2ffa..e544b082 100644 --- a/libi2pd/Destination.cpp +++ b/libi2pd/Destination.cpp @@ -869,11 +869,12 @@ namespace client else { // call later if tunnel is not ready - AddReadyCallback([&](const boost::system::error_code & ec) { + auto s = GetSharedFromThis(); + AddReadyCallback([s, streamRequestComplete, dest, port](const boost::system::error_code & ec) { if(ec) streamRequestComplete(nullptr); else - CreateStream(streamRequestComplete, dest, port); + s->CreateStream(streamRequestComplete, dest, port); }); } }