diff --git a/lib/icingadb/redisconnection.hpp b/lib/icingadb/redisconnection.hpp index 04c663585..84be22dba 100644 --- a/lib/icingadb/redisconnection.hpp +++ b/lib/icingadb/redisconnection.hpp @@ -514,13 +514,11 @@ void RedisConnection::Handshake(StreamPtr& strm, boost::asio::yield_context& yc) template Timeout::Ptr RedisConnection::MakeTimeout(StreamPtr& stream) { - Ptr keepAlive (this); - return new Timeout( m_Strand.context(), m_Strand, boost::posix_time::microseconds(intmax_t(m_ConnectTimeout * 1000000)), - [keepAlive, stream] { + [stream] { boost::system::error_code ec; stream->lowest_layer().cancel(ec); } diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 601367e49..913470bd4 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -687,7 +687,7 @@ void ApiListener::NewClientHandlerInternal( strand->context(), *strand, boost::posix_time::microseconds(intmax_t(Configuration::TlsHandshakeTimeout * 1000000)), - [strand, client] { + [client] { boost::system::error_code ec; client->lowest_layer().cancel(ec); }