aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.inl
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-10-09 16:46:42 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-10-09 16:46:42 +0100
commit7dbf76d0da5c78b8e987ce3fe1bf25781b02b82e (patch)
tree831f55935dba7a8c88fb2e0abc9c350c7184a215 /src/p2p/net_node.inl
parentMerge pull request #2548 (diff)
downloadmonero-7dbf76d0da5c78b8e987ce3fe1bf25781b02b82e.tar.xz
Fix an object lifetime bug in net load tests
The commands handler must not be destroyed before the config object, or we'll be accessing freed memory. An earlier attempt at using boost::shared_ptr to control object lifetime turned out to be very invasive, though would be a better solution in theory.
Diffstat (limited to '')
-rw-r--r--src/p2p/net_node.inl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 6162d649b..ee3ff160a 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -560,7 +560,7 @@ namespace nodetool
//configure self
m_net_server.set_threads_prefix("P2P");
- m_net_server.get_config_object().m_pcommands_handler = this;
+ m_net_server.get_config_object().set_handler(this);
m_net_server.get_config_object().m_invoke_timeout = P2P_DEFAULT_INVOKE_TIMEOUT;
m_net_server.set_connection_filter(this);