aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/tests/src
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 /contrib/epee/tests/src
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 'contrib/epee/tests/src')
-rw-r--r--contrib/epee/tests/src/net/test_net.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/epee/tests/src/net/test_net.h b/contrib/epee/tests/src/net/test_net.h
index 5b21036bb..2e1b1e5fd 100644
--- a/contrib/epee/tests/src/net/test_net.h
+++ b/contrib/epee/tests/src/net/test_net.h
@@ -155,7 +155,7 @@ namespace tests
bool init(const std::string& bind_port = "", const std::string& bind_ip = "0.0.0.0")
{
- 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 = 1000;
LOG_PRINT_L0("Binding on " << bind_ip << ":" << bind_port);
return m_net_server.init_server(bind_port, bind_ip);