summaryrefslogtreecommitdiff
path: root/src/temps.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-05-22 13:08:53 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-05-22 21:33:47 -0400
commit57abfd7ef8b4500b7a0c14d136d397ecf974163b (patch)
tree434c8b0538ba3fc80649feea284f5bd065bb30bb /src/temps.cc
parent9061db8e47d06db8502febafd202e44b2f9213ba (diff)
downloadfork-ledger-57abfd7ef8b4500b7a0c14d136d397ecf974163b.tar.gz
fork-ledger-57abfd7ef8b4500b7a0c14d136d397ecf974163b.tar.bz2
fork-ledger-57abfd7ef8b4500b7a0c14d136d397ecf974163b.zip
Temporary accounts were referenced after deletion
Fixes D53C98E5-506D-4CE5-91A3-7666FD33B65B
Diffstat (limited to 'src/temps.cc')
-rw-r--r--src/temps.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/temps.cc b/src/temps.cc
index 68b9ffa0..dcaa9101 100644
--- a/src/temps.cc
+++ b/src/temps.cc
@@ -91,9 +91,9 @@ post_t& temporaries_t::copy_post(post_t& origin, xact_t& xact,
post_temps->push_back(origin);
post_t& temp(post_temps->back());
+ temp.add_flags(ITEM_TEMP);
if (account)
temp.account = account;
- temp.add_flags(ITEM_TEMP);
temp.account->add_post(&temp);
xact.add_post(&temp);
@@ -109,8 +109,8 @@ post_t& temporaries_t::create_post(xact_t& xact, account_t * account)
post_temps->push_back(post_t(account));
post_t& temp(post_temps->back());
- temp.account = account;
temp.add_flags(ITEM_TEMP);
+ temp.account = account;
temp.account->add_post(&temp);
xact.add_post(&temp);
@@ -127,10 +127,10 @@ account_t& temporaries_t::create_account(const string& name,
acct_temps->push_back(account_t(parent, name));
account_t& temp(acct_temps->back());
+ temp.add_flags(ACCOUNT_TEMP);
if (parent)
parent->add_account(&temp);
- temp.add_flags(ACCOUNT_TEMP);
return temp;
}