summaryrefslogtreecommitdiff
path: root/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/main.cc b/main.cc
index 78a9433b..1a6f0ea2 100644
--- a/main.cc
+++ b/main.cc
@@ -462,16 +462,14 @@ int main(int argc, char * argv[], char * envp[])
session->register_parser(new ledger::qif_parser_t);
session->register_parser(new ledger::textual_parser_t);
- std::auto_ptr<ledger::report_t> report(new ledger::report_t(*session.get()));
+ session->current_report.reset(new ledger::report_t(*session.get()));
- status = read_and_report(*report.get(), argc, argv, envp);
+ status = read_and_report(*session->current_report.get(), argc, argv, envp);
- if (DO_VERIFY()) {
+ if (DO_VERIFY())
ledger::set_session_context();
- } else {
- report.release();
- session.release();
- }
+ else
+ session.release(); // don't free anything!
}
catch (const std::exception& err) {
std::cout.flush();