diff options
author | John Wiegley <johnw@newartisans.com> | 2008-08-10 01:41:59 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-08-10 01:41:59 -0400 |
commit | ba02f0a45036a1f9c64cd56533990d3284bcc4cf (patch) | |
tree | f261e8d3cadb5d3dccd904b7c8c7fe5e90811aa3 /src/main.cc | |
parent | c9d575abceb672d1c23383d973adee40daeecda8 (diff) | |
download | fork-ledger-ba02f0a45036a1f9c64cd56533990d3284bcc4cf.tar.gz fork-ledger-ba02f0a45036a1f9c64cd56533990d3284bcc4cf.tar.bz2 fork-ledger-ba02f0a45036a1f9c64cd56533990d3284bcc4cf.zip |
Fixed a memory leak that would show up if --verify --verbose was running and
an error or exception occurred.
Diffstat (limited to 'src/main.cc')
-rw-r--r-- | src/main.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main.cc b/src/main.cc index a5ca02d0..0b89c9f1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -566,9 +566,7 @@ int main(int argc, char * argv[], char * envp[]) status = read_and_report(*session->current_report.get(), argc, argv, envp); - if (DO_VERIFY()) - ledger::set_session_context(); - else + if (! DO_VERIFY()) session.release(); // don't free anything! just let it leak } catch (const std::exception& err) { @@ -582,6 +580,7 @@ int main(int argc, char * argv[], char * envp[]) IF_VERIFY() { INFO("Ledger ended (Boost/libstdc++ may still hold memory)"); + ledger::set_session_context(); ledger::shutdown_memory_tracing(); } else { INFO("Ledger ended"); |