From e92bcf411d2e9a55969303ba3893a017152d7c18 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 1 May 2007 04:36:49 +0000 Subject: Started using boost::optional. --- src/binary.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/binary.cc') diff --git a/src/binary.cc b/src/binary.cc index d3238b5a..55d8e03a 100644 --- a/src/binary.cc +++ b/src/binary.cc @@ -59,7 +59,7 @@ void read_binary_string(std::istream& in, string& str) in.read(buf, slen); buf[slen] = '\0'; str = buf; - delete[] buf; + checked_array_delete(buf); } else if (len) { char buf[256]; @@ -374,7 +374,7 @@ account_t * read_binary_account(char *& data, journal_t * journal, // journal's own master account. if (master && acct != master) { - delete acct; + checked_delete(acct); acct = master; } @@ -441,7 +441,7 @@ unsigned int read_binary_journal(std::istream& in, accounts = accounts_next = new account_t *[a_count]; assert(journal->master); - delete journal->master; + checked_delete(journal->master); journal->master = read_binary_account(data, journal, master); if (read_binary_bool(data)) @@ -501,14 +501,14 @@ unsigned int read_binary_journal(std::istream& in, (*c).second->precision = commodity->precision; (*c).second->flags = commodity->flags; if ((*c).second->smaller) - delete (*c).second->smaller; + checked_delete((*c).second->smaller); (*c).second->smaller = commodity->smaller; if ((*c).second->larger) - delete (*c).second->larger; + checked_delete((*c).second->larger); (*c).second->larger = commodity->larger; *(base_commodities_next - 1) = (*c).second; - delete commodity; + checked_delete(commodity); } } @@ -538,7 +538,7 @@ unsigned int read_binary_journal(std::istream& in, commodity->symbol()); *(commodities_next - 1) = (*c).second; - delete commodity; + checked_delete(commodity); } } @@ -583,9 +583,9 @@ unsigned int read_binary_journal(std::istream& in, // Clean up and return the number of entries read - delete[] accounts; - delete[] commodities; - delete[] data_pool; + checked_array_delete(accounts); + checked_array_delete(commodities); + checked_array_delete(data_pool); VALIDATE(journal->valid()); -- cgit v1.2.3