summaryrefslogtreecommitdiff
path: root/gnucash.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gnucash.cc')
-rw-r--r--gnucash.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnucash.cc b/gnucash.cc
index 7866f9c0..7400bdbe 100644
--- a/gnucash.cc
+++ b/gnucash.cc
@@ -204,8 +204,17 @@ static void dataHandler(void *userData, const char *s, int len)
xact->acct = (*i).second;
std::string value = curr_quant + " " + (*i).second->comm->symbol;
+
+ if (curr_value->comm() == (*i).second->comm) {
+ // assert: value must be equal to curr_value.
+ delete curr_value;
+ curr_value = NULL;
+ }
xact->cost = create_amount(value.c_str(), curr_value);
+ if (curr_value)
+ delete curr_value;
+
if (do_compute)
xact->acct->balance.credit(xact->cost);
break;