diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/report.cc | 9 |
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_)) { |