Porting memory fixes

This commit is contained in:
Wladimir J. van der Laan
2017-01-18 19:24:02 +01:00
committed by mtjburton
parent 128139cdeb
commit effed14ca3
5 changed files with 43 additions and 21 deletions

View File

@@ -23,6 +23,8 @@
using namespace std;
std::vector<std::unique_ptr<CWalletTx>> wtxn;
typedef set<pair<const CWalletTx*,unsigned int> > CoinSet;
BOOST_FIXTURE_TEST_SUITE(wallet_tests, TestingSetup)
@@ -50,13 +52,13 @@ static void add_coin(const CAmount& nValue, int nAge = 6*24, bool fIsFromMe = fa
}
COutput output(wtx, nInput, nAge, true);
vCoins.push_back(output);
wtxn.emplace_back(std::move(wtx));
}
static void empty_wallet(void)
{
BOOST_FOREACH(COutput output, vCoins)
delete output.tx;
vCoins.clear();
wtxn.clear();
}
static bool equal_sets(CoinSet a, CoinSet b)