From ac000a67c4e9c75e11e43018e5f16242b4d99226 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 25 Aug 2004 21:02:07 -0400 Subject: fixed two memory corruption bugs --- ledger.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ledger.cc') diff --git a/ledger.cc b/ledger.cc index d2a3bf15..3a6f1016 100644 --- a/ledger.cc +++ b/ledger.cc @@ -68,6 +68,8 @@ bool entry_t::valid() const return true; } +void clean_commodity_history(char * item_pool, char * item_pool_end); + journal_t::~journal_t() { DEBUG_PRINT("ledger.memory.dtors", "dtor journal_t"); @@ -86,6 +88,9 @@ journal_t::~journal_t() else (*i)->~entry_t(); + // Remove historical prices which were allocated in the item_pool. + clean_commodity_history(item_pool, item_pool_end); + if (item_pool) delete[] item_pool; } -- cgit v1.2.3