From 3759fd4ac4f1cabc24df545db00073e3d7772534 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Thu, 22 Jun 2023 09:26:05 +0200 Subject: [PATCH] Code cleanup --- src/p2pool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/p2pool.cpp b/src/p2pool.cpp index 0fc8f83..eb0c056 100644 --- a/src/p2pool.cpp +++ b/src/p2pool.cpp @@ -1024,7 +1024,7 @@ void p2pool::get_version() const Params::Host host = current_host(); JSONRPCRequest::call(host.m_address, host.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_version\"}", host.m_rpcLogin, m_params->m_socks5Proxy, - [this, host](const char* data, size_t size, double) + [this](const char* data, size_t size, double) { parse_get_version_rpc(data, size); }, @@ -1688,7 +1688,11 @@ int p2pool::run() load_found_blocks(); const int rc = uv_run(uv_default_loop_checked(), UV_RUN_DEFAULT); LOGINFO(1, "uv_run exited, result = " << rc); + + WriteLock lock(m_ZMQReaderLock); + delete m_ZMQReader; + m_ZMQReader = nullptr; } catch (const std::exception& e) { const char* s = e.what();