summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-27 05:23:24 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-27 05:23:24 -0400
commitf20b6a3b9edc2ace7b85eb4c961d57f69d98ea09 (patch)
tree626964538623e45b842c5344905c761ea01467a3 /src
parent6a2c6db071f00928f5b719ce585689c770e6a6d0 (diff)
downloadfork-ledger-f20b6a3b9edc2ace7b85eb4c961d57f69d98ea09.tar.gz
fork-ledger-f20b6a3b9edc2ace7b85eb4c961d57f69d98ea09.tar.bz2
fork-ledger-f20b6a3b9edc2ace7b85eb4c961d57f69d98ea09.zip
Fixed a data lifetime bug
This was causing budget totals not to appear in balance reports. Fixes 8254755E-7B61-47C8-B48E-A2A7FD79EB80
Diffstat (limited to 'src')
-rw-r--r--src/report.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/report.cc b/src/report.cc
index 53426f39..6fc7626f 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -77,8 +77,13 @@ void report_t::xact_report(post_handler_ptr handler, xact_t& xact)
void report_t::accounts_report(acct_handler_ptr handler)
{
journal_posts_iterator walker(*session.journal.get());
- pass_down_posts(chain_post_handlers(*this, post_handler_ptr(new ignore_posts),
- true), walker);
+
+ // The lifetime of the chain object controls the lifetime of all temporary
+ // objects created within it during the call to pass_down_posts, which will
+ // be needed later by the pass_down_accounts.
+ post_handler_ptr chain =
+ chain_post_handlers(*this, post_handler_ptr(new ignore_posts), true);
+ pass_down_posts(chain, walker);
scoped_ptr<accounts_iterator> iter;
if (! HANDLED(sort_)) {