From 6b6ca6d4c70df0e4a3009ee093cf2f83ecee2675 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 1 Nov 2009 21:14:05 -0500 Subject: Improved the way account temporaries are managed --- src/temps.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/temps.cc') diff --git a/src/temps.cc b/src/temps.cc index f2dee159..e44aaaa7 100644 --- a/src/temps.cc +++ b/src/temps.cc @@ -48,6 +48,11 @@ temporaries_t::~temporaries_t() if (! post.account->has_flags(ACCOUNT_TEMP)) post.account->remove_post(&post); } + + foreach (account_t& acct, *acct_temps) { + if (! acct.has_flags(ACCOUNT_TEMP)) + acct.remove_account(&acct); + } } } @@ -120,6 +125,9 @@ account_t& temporaries_t::create_account(const string& name, acct_temps->push_back(account_t(parent, name)); account_t& temp(acct_temps->back()); + if (parent) + parent->add_account(&temp); + temp.add_flags(ACCOUNT_TEMP); return temp; } -- cgit v1.2.3