From af79a4c70f4ac9f1400553e5402cea517e20c7f6 Mon Sep 17 00:00:00 2001 From: John Emmons Date: Fri, 23 Jan 2009 18:23:05 +0000 Subject: [PATCH] ICU-6694 Fix to delete internal NumberingSystems when they are no longer needed X-SVN-Rev: 25306 --- icu4c/source/i18n/dcfmtsym.cpp | 3 +++ icu4c/source/i18n/numfmt.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/icu4c/source/i18n/dcfmtsym.cpp b/icu4c/source/i18n/dcfmtsym.cpp index 5b87849595a..525f104b655 100644 --- a/icu4c/source/i18n/dcfmtsym.cpp +++ b/icu4c/source/i18n/dcfmtsym.cpp @@ -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 diff --git a/icu4c/source/i18n/numfmt.cpp b/icu4c/source/i18n/numfmt.cpp index a7f4d51fa5f..c3f025f6304 100644 --- a/icu4c/source/i18n/numfmt.cpp +++ b/icu4c/source/i18n/numfmt.cpp @@ -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) {