diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-10-16 13:35:55 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-10-16 13:35:55 -0500 |
commit | 7ec8d9640e2a47526acab470c4f23aed4fe646d7 (patch) | |
tree | fd0afd17c42a00c4f27a38ca28bf2528e751e1f9 /contrib/epee | |
parent | Merge pull request #5988 (diff) | |
parent | levin: armour against some "should not happen" case (diff) | |
download | monero-7ec8d9640e2a47526acab470c4f23aed4fe646d7.tar.xz |
Merge pull request #5911
e48dcb7 levin: armour against some 'should not happen' case (moneromooo-monero)
Diffstat (limited to 'contrib/epee')
-rw-r--r-- | contrib/epee/include/net/levin_protocol_handler_async.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/epee/include/net/levin_protocol_handler_async.h b/contrib/epee/include/net/levin_protocol_handler_async.h index 41f01e9a0..5774c0ba7 100644 --- a/contrib/epee/include/net/levin_protocol_handler_async.h +++ b/contrib/epee/include/net/levin_protocol_handler_async.h @@ -272,6 +272,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) + { + MERROR("Adding response handler to a released object"); + return false; + } boost::shared_ptr<invoke_response_handler_base> handler(boost::make_shared<anvoke_handler<callback_t>>(cb, timeout, con, command)); m_invoke_response_handlers.push_back(handler); return handler->is_timer_started(); |