aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-02-12 14:37:18 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-02-13 22:39:25 +0000
commitb560ed4ac69f6c27376c51db0d69d496873e16d2 (patch)
treeee359ffa9714df7593a8a9d465ee502d5205cdd8 /src
parentMerge pull request #1718 (diff)
downloadmonero-b560ed4ac69f6c27376c51db0d69d496873e16d2.tar.xz
daemon: silence spurious warning about uninitialized variable
Also fixes a leak
Diffstat (limited to 'src')
-rw-r--r--src/daemon/daemon.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp
index 19013cbc8..670c33128 100644
--- a/src/daemon/daemon.cpp
+++ b/src/daemon/daemon.cpp
@@ -124,18 +124,18 @@ bool t_daemon::run(bool interactive)
return false;
mp_internals->rpc.run();
- daemonize::t_command_server* rpc_commands;
+ std::unique_ptr<daemonize::t_command_server> rpc_commands;
if (interactive)
{
// The first three variables are not used when the fourth is false
- rpc_commands = new daemonize::t_command_server(0, 0, boost::none, false, mp_internals->rpc.get_server());
+ rpc_commands.reset(new daemonize::t_command_server(0, 0, boost::none, false, mp_internals->rpc.get_server()));
rpc_commands->start_handling(std::bind(&daemonize::t_daemon::stop_p2p, this));
}
mp_internals->p2p.run(); // blocks until p2p goes down
- if (interactive)
+ if (rpc_commands)
{
rpc_commands->stop_handling();
}