X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=83afc78bb27640be6527cfc1b748092c5c81c676;hp=21eef1ed80e1b984f5d67084119506143682dec6;hb=17a6c72f2ee4421c07d002983a1f11645b008934;hpb=d041e87aaf08bb731a6a839d135a0a444b717ede diff --git a/src/main.cpp b/src/main.cpp index 21eef1e..83afc78 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4103,3 +4103,25 @@ bool SendMessages(CNode* pto, bool fSendTrickle) } return true; } + + +class CMainCleanup +{ +public: + CMainCleanup() {} + ~CMainCleanup() { + // block headers + std::map::iterator it1 = mapBlockIndex.begin(); + for (; it1 != mapBlockIndex.end(); it1++) + delete (*it1).second; + mapBlockIndex.clear(); + + // orphan blocks + std::map::iterator it2 = mapOrphanBlocks.begin(); + for (; it2 != mapOrphanBlocks.end(); it2++) + delete (*it2).second; + mapOrphanBlocks.clear(); + + // orphan transactions + } +} instance_of_cmaincleanup; \ No newline at end of file