diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-28 02:34:40 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-28 02:34:40 -0400 |
commit | bd96928410124e70e70ada7fd05820e2cf781d2c (patch) | |
tree | a054e62051e8a2cdb7351f9b166a1fba5d5ba43f /src/xact.cc | |
parent | ade0a8b6f3eeb893eda2ae7355d503bf6514f147 (diff) | |
parent | 65e8eca6cfd394390c1e2091cf8674a93d2eae2d (diff) | |
download | fork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.tar.gz fork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.tar.bz2 fork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.zip |
Merge branch 'next'
Diffstat (limited to 'src/xact.cc')
-rw-r--r-- | src/xact.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/xact.cc b/src/xact.cc index 6ea8d8f9..9f118ec2 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -49,16 +49,23 @@ xact_base_t::~xact_base_t() { TRACE_DTOR(xact_base_t); - foreach (post_t * post, posts) { - // If the posting is a temporary, it will be destructed when the - // temporary is. - if (! post->has_flags(ITEM_TEMP)) + if (! has_flags(ITEM_TEMP)) { + foreach (post_t * post, posts) { + // If the posting is a temporary, it will be destructed when the + // temporary is. + assert(! post->has_flags(ITEM_TEMP)); checked_delete(post); + } } } void xact_base_t::add_post(post_t * post) { + // You can add temporary postings to transactions, but not real postings to + // temporary transactions. + if (! post->has_flags(ITEM_TEMP)) + assert(! has_flags(ITEM_TEMP)); + posts.push_back(post); } |