return;
}
- static NumberingSystem *ns = NumberingSystem::createInstance(loc,status);
+ NumberingSystem *ns = NumberingSystem::createInstance(loc,status);
UErrorCode ec = U_ZERO_ERROR;
UResourceBundle *rb = ures_open(NULL, loc.getName(), &ec);
UResourceBundle *numElements = ures_getByKeyWithFallback(rb, gNumberElementsTag, NULL, &ec);
ures_close(numElements);
ures_close(rb);
+ delete ns;
if (U_FAILURE(ec)) {
return;
ures_close(top);
}
+ delete ns;
+
if (U_FAILURE(status))
{
return;
}
NumberingSystem *ns = NumberingSystem::createInstance(fSymbols->getLocale(),status);
+ if (U_FAILURE(status)) {
+ return;
+ }
// Save the default currency patterns of this locale.
// Here, chose onlyApplyPatternWithoutExpandAffix without
}
ures_close(numElements);
ures_close(resource);
+ delete ns;
if (U_SUCCESS(error)) {
applyPatternWithoutExpandAffix(UnicodeString(patResStr, patLen), false,
patResStr = ures_getStringByKeyWithFallback(resource, gFormatKeys[style], &patLen, &status);
}
+ ures_close(numElements);
+
// Creates the specified decimal format style of the desired locale.
pattern.setTo(TRUE, patResStr, patLen);
}
}
if ( availableNames == NULL ) {
- UVector *fNumsysNames = new UVector(status);
+ UVector *fNumsysNames = new UVector(uprv_deleteUObject, NULL, status);
if (U_FAILURE(status)) {
status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
if ( uprv_strcmp(nsname,ns->getName()) ) {
errln("FAIL: Numbering system name didn't match for name = %s\n",nsname);
}
+
+ delete ns;
}
+
+ delete availableNumberingSystems;
}
#endif /* #if !UCONFIG_NO_FORMATTING */