diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2017-08-09 17:08:22 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2017-11-09 16:53:34 +0100 |
commit | d223bc940a16712f221f634047408e8771dff26c (patch) | |
tree | 2dcf31ccfdc50d7502a4626b21ace3d1613d45c1 /src/test/test_bitcoin.cpp | |
parent | b45c597caadabbf10a1e34f2c9ee1d0916164eee (diff) |
Use unique_ptr for pcoinscatcher/pcoinsdbview/pcoinsTip/pblocktree
* pcoinscatcher (CCoinsViewErrorCatcher)
* pcoinsdbview (CCoinsViewDB)
* pcoinsTip (CCoinsViewCache)
* pblocktree (CBlockTreeDB)
* Remove variables shadowing pcoinsdbview
Diffstat (limited to 'src/test/test_bitcoin.cpp')
-rw-r--r-- | src/test/test_bitcoin.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index f9ce52c594..0d7d52478f 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -81,9 +81,9 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); mempool.setSanityCheck(1.0); - pblocktree = new CBlockTreeDB(1 << 20, true); - pcoinsdbview = new CCoinsViewDB(1 << 23, true); - pcoinsTip = new CCoinsViewCache(pcoinsdbview); + pblocktree.reset(new CBlockTreeDB(1 << 20, true)); + pcoinsdbview.reset(new CCoinsViewDB(1 << 23, true)); + pcoinsTip.reset(new CCoinsViewCache(pcoinsdbview.get())); if (!LoadGenesisBlock(chainparams)) { throw std::runtime_error("LoadGenesisBlock failed."); } @@ -110,9 +110,9 @@ TestingSetup::~TestingSetup() g_connman.reset(); peerLogic.reset(); UnloadBlockIndex(); - delete pcoinsTip; - delete pcoinsdbview; - delete pblocktree; + pcoinsTip.reset(); + pcoinsdbview.reset(); + pblocktree.reset(); fs::remove_all(pathTemp); } |