Merge pull request #1711

cf2e75eb daemon: fix crash on exit when mining (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2017-02-12 23:24:49 +02:00
commit b1df7f114d
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD

View File

@ -141,6 +141,7 @@ bool t_daemon::run(bool interactive)
} }
mp_internals->rpc.stop(); mp_internals->rpc.stop();
mp_internals->core.get().get_miner().stop();
MGINFO("Node stopped."); MGINFO("Node stopped.");
return true; return true;
} }
@ -162,6 +163,7 @@ void t_daemon::stop()
{ {
throw std::runtime_error{"Can't stop stopped daemon"}; throw std::runtime_error{"Can't stop stopped daemon"};
} }
mp_internals->core.get().get_miner().stop();
mp_internals->p2p.stop(); mp_internals->p2p.stop();
mp_internals->rpc.stop(); mp_internals->rpc.stop();
mp_internals.reset(nullptr); // Ensure resources are cleaned up before we return mp_internals.reset(nullptr); // Ensure resources are cleaned up before we return