From e000d36b3c9187539bdb36ba18d0d8c0c218a399 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Fri, 7 Aug 2015 19:50:35 +0200 Subject: [PATCH] debug --- libp2p/NodeTable.cpp | 15 ++++++++++++--- libp2p/NodeTable.h | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libp2p/NodeTable.cpp b/libp2p/NodeTable.cpp index 44ab0aa99..19c86cc0f 100644 --- a/libp2p/NodeTable.cpp +++ b/libp2p/NodeTable.cpp @@ -46,6 +46,7 @@ NodeTable::NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint m_socket(new NodeSocket(_io, *this, (bi::udp::endpoint)m_node.endpoint)), m_socketPointer(m_socket.get()), m_timers(_io) + ,m_debug_destroyed(false) { for (unsigned i = 0; i < s_bins; i++) m_state[i].distance = i; @@ -67,8 +68,12 @@ NodeTable::NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint NodeTable::~NodeTable() { - m_timers.stop(); - m_socketPointer->disconnect(); + DEV_GUARDED(x_debug) + { + m_debug_destroyed = true; + m_timers.stop(); + m_socketPointer->disconnect(); + } } void NodeTable::processEvents() @@ -200,7 +205,11 @@ void NodeTable::doDiscover(NodeId _node, unsigned _round, shared_ptr