Skip to content

Commit

Permalink
ICU-20036 CurrencyPluralInfo class improve handling of OOM errors (#17)
Browse files Browse the repository at this point in the history
ICU-20036 CurrencyPluralInfo class doesn't always check/handle OOM errors.

Changes include:
- Using LocalPointer instead of raw new/delete, in order to make the code cleaner.
- Using nullptr instead of NULL.
- Inspired by Andy's review feedback PluralRules changes, this change sets fPluralRules and fLocale to nullptr in the assignment operator in order to prevent possible double deletes in the failure case.
- More consistent about not checking for nullptr when calling delete.
- Using LocalUResourceBundlePointer in order to simply the code and not need manual deletes.
- Reduce memory usage by using the same LocalUResourceBundle with .getAlias() instead of allocating new ones.
  • Loading branch information
jefgen authored and sffc committed Aug 6, 2018
1 parent 71a7f9c commit 2df32ad
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 124 deletions.
Loading

0 comments on commit 2df32ad

Please sign in to comment.