diff options
author | John Wiegley <johnw@newartisans.com> | 2008-07-26 05:06:06 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-07-26 05:06:06 -0400 |
commit | 162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f (patch) | |
tree | 1d29680db03ab4f8a82f77630a6e1a9fc10571bb /main.cc | |
parent | 961b30926b3b9f2b3e9c1a99df3f25fea6b13118 (diff) | |
download | fork-ledger-162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f.tar.gz fork-ledger-162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f.tar.bz2 fork-ledger-162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f.zip |
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.
Diffstat (limited to 'main.cc')
-rw-r--r-- | main.cc | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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<item_handler<transaction_t> *>::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) { |