From f2b8562813925e1de805e8cd0a3c5b17f019a504 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Wed, 16 Oct 2019 22:53:46 +0200 Subject: [PATCH] fix of the levin(stolen from @moneromooo-monero) --- contrib/epee/include/net/levin_protocol_handler_async.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/epee/include/net/levin_protocol_handler_async.h b/contrib/epee/include/net/levin_protocol_handler_async.h index 7d000632..c3cdd02d 100644 --- a/contrib/epee/include/net/levin_protocol_handler_async.h +++ b/contrib/epee/include/net/levin_protocol_handler_async.h @@ -220,6 +220,11 @@ public: bool add_invoke_response_handler(const callback_t& cb, uint64_t timeout, async_protocol_handler& con, int command) { CRITICAL_REGION_LOCAL(m_invoke_response_handlers_lock); + if (m_protocol_released) + { + LOG_PRINT_L0("ERROR: Adding response handler to a released object"); + return false; + } boost::shared_ptr handler(boost::make_shared>(cb, timeout, con, command)); m_invoke_response_handlers.push_back(handler); LOG_PRINT_L4("[LEVIN_PROTOCOL" << this << "] INVOKE_HANDLER_QUE: PUSH_BACK RESPONSE HANDLER");