summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-10 01:41:59 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-10 01:41:59 -0400
commitba02f0a45036a1f9c64cd56533990d3284bcc4cf (patch)
treef261e8d3cadb5d3dccd904b7c8c7fe5e90811aa3 /src/main.cc
parentc9d575abceb672d1c23383d973adee40daeecda8 (diff)
downloadfork-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.cc5
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");