diff options
Diffstat (limited to 'ledger.cc')
-rw-r--r-- | ledger.cc | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -8,6 +8,8 @@ namespace ledger { const std::string version = "2.0b"; +#ifdef DO_CLEANUP + journal_t::~journal_t() { DEBUG_PRINT("ledger.memory.dtors", "dtor journal_t"); @@ -20,9 +22,16 @@ journal_t::~journal_t() for (entries_list::iterator i = entries.begin(); i != entries.end(); i++) - delete *i; + if (! item_pool || + ((char *) *i) < item_pool || ((char *) *i) >= item_pool_end) + delete *i; + + if (item_pool) + delete[] item_pool; } +#endif // DO_CLEANUP + bool journal_t::add_entry(entry_t * entry) { entries.push_back(entry); |