From ba02f0a45036a1f9c64cd56533990d3284bcc4cf Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 10 Aug 2008 01:41:59 -0400 Subject: Fixed a memory leak that would show up if --verify --verbose was running and an error or exception occurred. --- src/main.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main.cc') 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"); -- cgit v1.2.3