diff --git a/src/wallet/test/wallet_test_fixture.cpp b/src/wallet/test/wallet_test_fixture.cpp index 6834e7f46..c88fd7591 100644 --- a/src/wallet/test/wallet_test_fixture.cpp +++ b/src/wallet/test/wallet_test_fixture.cpp @@ -1,19 +1,26 @@ // Copyright (c) 2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include #include +#include #include #include WalletTestingSetup::WalletTestingSetup(const std::string &chainName) : TestingSetup(chainName), m_chain(interfaces::MakeChain(m_node, Params())), m_wallet(m_chain.get(), "", CreateMockWalletDatabase()) { bool fFirstRun; m_wallet.LoadWallet(fFirstRun); m_chain_notifications_handler = m_chain->handleNotifications({&m_wallet, [](CWallet *) {}}); m_wallet_client->registerRpcs(); } + +WalletTestingSetup::~WalletTestingSetup() { + if (m_node.scheduler) { + m_node.scheduler->stop(); + } +} diff --git a/src/wallet/test/wallet_test_fixture.h b/src/wallet/test/wallet_test_fixture.h index 9cf09c594..cc6a495f2 100644 --- a/src/wallet/test/wallet_test_fixture.h +++ b/src/wallet/test/wallet_test_fixture.h @@ -1,32 +1,33 @@ // Copyright (c) 2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H #define BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H #include #include #include #include #include #include #include /** * Testing setup and teardown for wallet. */ struct WalletTestingSetup : public TestingSetup { explicit WalletTestingSetup( const std::string &chainName = CBaseChainParams::MAIN); + ~WalletTestingSetup(); std::unique_ptr m_chain; std::unique_ptr m_wallet_client = interfaces::MakeWalletClient(*m_chain, *Assert(m_node.args)); CWallet m_wallet; std::unique_ptr m_chain_notifications_handler; }; #endif // BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H