mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 18:25:57 +00:00
ICU-10914 Fix uses of createSharedInstance calls.
X-SVN-Rev: 35748
This commit is contained in:
parent
4b0e17ff66
commit
df067d53b2
1 changed files with 8 additions and 10 deletions
|
@ -641,23 +641,21 @@ void MeasureFormat::initMeasureFormat(
|
|||
return;
|
||||
}
|
||||
|
||||
SharedObject::copyPtr(
|
||||
PluralRules::createSharedInstance(
|
||||
locale, UPLURAL_TYPE_CARDINAL, status),
|
||||
pluralRules);
|
||||
const SharedPluralRules *pr = PluralRules::createSharedInstance(
|
||||
locale, UPLURAL_TYPE_CARDINAL, status);
|
||||
if (U_FAILURE(status)) {
|
||||
return;
|
||||
}
|
||||
pluralRules->removeRef();
|
||||
SharedObject::copyPtr(pr, pluralRules);
|
||||
pr->removeRef();
|
||||
if (nf.isNull()) {
|
||||
SharedObject::copyPtr(
|
||||
NumberFormat::createSharedInstance(
|
||||
locale, UNUM_DECIMAL, status),
|
||||
numberFormat);
|
||||
const SharedNumberFormat *shared = NumberFormat::createSharedInstance(
|
||||
locale, UNUM_DECIMAL, status);
|
||||
if (U_FAILURE(status)) {
|
||||
return;
|
||||
}
|
||||
numberFormat->removeRef();
|
||||
SharedObject::copyPtr(shared, numberFormat);
|
||||
shared->removeRef();
|
||||
} else {
|
||||
adoptNumberFormat(nf.orphan(), status);
|
||||
if (U_FAILURE(status)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue