ICU-13788 Fixing small memory leak in ucurr.cpp; always register the main currency_cleanup function, not the helper functions.

X-SVN-Rev: 41447
This commit is contained in:
Shane Carr 2018-05-24 04:19:28 +00:00
parent 58b7fe2e32
commit 58b1463158

View File

@ -1500,7 +1500,7 @@ getCacheEntry(const char* locale, UErrorCode& ec) {
cacheEntry->totalCurrencySymbolCount = total_currency_symbol_count;
cacheEntry->refCount = 2; // one for cache, one for reference
currentCacheEntryIndex = (currentCacheEntryIndex + 1) % CURRENCY_NAME_CACHE_NUM;
ucln_common_registerCleanup(UCLN_COMMON_CURRENCY, currency_cache_cleanup);
ucln_common_registerCleanup(UCLN_COMMON_CURRENCY, currency_cleanup);
} else {
deleteCurrencyNames(currencyNames, total_currency_name_count);
deleteCurrencyNames(currencySymbols, total_currency_symbol_count);