diff options
| author | Jonas Schnelli <[email protected]> | 2013-04-02 21:53:41 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2013-04-02 21:53:41 +0200 |
| commit | 6f21d15375c0ca264a4bc3470685e0f364fa8ffe (patch) | |
| tree | 04c59f05614eb95490625c8d1b9ca3e1b91b25d1 /src/main.cpp | |
| parent | change new mac icon license to public domain (diff) | |
| parent | Merge pull request #2420 from sipa/globclean (diff) | |
| download | discoin-6f21d15375c0ca264a4bc3470685e0f364fa8ffe.tar.xz discoin-6f21d15375c0ca264a4bc3470685e0f364fa8ffe.zip | |
Merge branch 'master' of git://github.com/bitcoin/bitcoin
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index b29091b4f..60593c0d5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4764,3 +4764,29 @@ uint64 CTxOutCompressor::DecompressAmount(uint64 x) } return n; } + + +class CMainCleanup +{ +public: + CMainCleanup() {} + ~CMainCleanup() { + // block headers + std::map<uint256, CBlockIndex*>::iterator it1 = mapBlockIndex.begin(); + for (; it1 != mapBlockIndex.end(); it1++) + delete (*it1).second; + mapBlockIndex.clear(); + + // orphan blocks + std::map<uint256, CBlock*>::iterator it2 = mapOrphanBlocks.begin(); + for (; it2 != mapOrphanBlocks.end(); it2++) + delete (*it2).second; + mapOrphanBlocks.clear(); + + // orphan transactions + std::map<uint256, CDataStream*>::iterator it3 = mapOrphanTransactions.begin(); + for (; it3 != mapOrphanTransactions.end(); it3++) + delete (*it3).second; + mapOrphanTransactions.clear(); + } +} instance_of_cmaincleanup; |