summaryrefslogtreecommitdiff
path: root/src/temps.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/temps.cc')
-rw-r--r--src/temps.cc8
1 files changed, 8 insertions, 0 deletions
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;
}