From 162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 26 Jul 2008 05:06:06 -0400 Subject: The --verify option is now working properly again. Use "--verify --verbose" if you wish to see memory usage statistics along with a top-level trace. --- main.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'main.cc') diff --git a/main.cc b/main.cc index 28b8edc3..a776448e 100644 --- a/main.cc +++ b/main.cc @@ -314,6 +314,31 @@ static int read_and_report(ledger::report_t& report, int argc, char * argv[], INFO_FINISH(command); + // Clean up memory, if we + + if (DO_VERIFY()) { + TRACE_START(cleanup, 1, "Cleaning up allocated memory"); + + clear_transaction_xdata xact_cleaner; + walk_entries(journal.entries, xact_cleaner); + + clear_account_xdata acct_cleaner; + walk_accounts(*journal.master, acct_cleaner); + + if (report.output_file) + checked_delete(out); + +#if 0 + for (std::list *>::iterator i + = formatter_ptrs.begin(); + i != formatter_ptrs.end(); + i++) + checked_delete(*i); +#endif + + TRACE_FINISH(cleanup, 1); + } + // Write out the binary cache, if need be if (session.use_cache && session.cache_dirty && session.cache_file) { -- cgit v1.2.3