summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-21 03:48:02 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-21 03:48:02 -0400
commitaeea1cb3e1c5c158294e1f08543065c2e602c94e (patch)
tree6faa36fab7bd2c2c2b04046a493a60e0ca9eee6b /src/value.cc
parent5d50d895bf4aaa139c4b632820b661de383b2ef3 (diff)
downloadledger-aeea1cb3e1c5c158294e1f08543065c2e602c94e.tar.gz
ledger-aeea1cb3e1c5c158294e1f08543065c2e602c94e.tar.bz2
ledger-aeea1cb3e1c5c158294e1f08543065c2e602c94e.zip
Fixed a memory leak in value_t::storage_t
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/value.cc b/src/value.cc
index a7d3c7e5..90067bba 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -119,7 +119,7 @@ void value_t::set_type(type_t new_type)
if (! storage || storage->refc > 1)
storage = new storage_t;
else
- storage->data = false; // destruct all other types
+ storage->destroy();
storage->type = new_type;
assert(is_type(new_type));
}
@@ -911,7 +911,7 @@ void value_t::in_place_cast(type_t cast_type)
if (amt.is_null())
set_balance(balance_t());
else
- set_balance(as_amount()); // creates temporary
+ set_balance(as_amount());
return;
case STRING:
if (amt.is_null())