diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-01 04:36:49 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:35 -0400 |
commit | e92bcf411d2e9a55969303ba3893a017152d7c18 (patch) | |
tree | e7b52d09751de39c86ede91f88a2fcf24facfb27 /src/binary.cc | |
parent | 50a9caf302936ba6f61bbe05b4718f199d0d584c (diff) | |
download | fork-ledger-e92bcf411d2e9a55969303ba3893a017152d7c18.tar.gz fork-ledger-e92bcf411d2e9a55969303ba3893a017152d7c18.tar.bz2 fork-ledger-e92bcf411d2e9a55969303ba3893a017152d7c18.zip |
Started using boost::optional<T>.
Diffstat (limited to 'src/binary.cc')
-rw-r--r-- | src/binary.cc | 20 |
1 files changed, 10 insertions, 10 deletions
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()); |