ICU-6694 Fix to delete internal NumberingSystems when they are no longer needed

X-SVN-Rev: 25306
This commit is contained in:
John Emmons 2009-01-23 18:23:05 +00:00
parent 07e008ff60
commit af79a4c70f
2 changed files with 6 additions and 0 deletions

View file

@ -169,6 +169,9 @@ DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status,
UnicodeString zeroDigit(ns->getDescription(),0,1);
setSymbol(kZeroDigitSymbol,zeroDigit);
}
if (ns) {
delete ns;
}
// Obtain currency data from the currency API. This is strictly
// for backward compatibility; we don't use DecimalFormatSymbols

View file

@ -923,6 +923,9 @@ NumberFormat::makeInstance(const Locale& desiredLocale,
cleanup:
ures_close(numberPatterns);
ures_close(resource);
if (ns) {
delete ns;
}
if (U_FAILURE(status)) {
/* If f exists, then it will delete the symbols */
if (f==NULL) {