diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-09 16:46:42 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-09 16:46:42 +0100 |
commit | 7dbf76d0da5c78b8e987ce3fe1bf25781b02b82e (patch) | |
tree | 831f55935dba7a8c88fb2e0abc9c350c7184a215 /src | |
parent | Merge pull request #2548 (diff) | |
download | monero-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 'src')
-rw-r--r-- | src/p2p/net_node.inl | 2 |
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); |