ICU-8273 Delete object before creating a new one in PluralFormat copy assignment operator.
X-SVN-Rev: 29951
This commit is contained in:
parent
c6bd9357a9
commit
4dc0689cab
@ -122,6 +122,13 @@ PluralFormat::PluralFormat(const PluralFormat& other)
|
||||
void
|
||||
PluralFormat::copyObjects(const PluralFormat& other) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
if (numberFormat != NULL) {
|
||||
delete numberFormat;
|
||||
}
|
||||
if (pluralRulesWrapper.pluralRules != NULL) {
|
||||
delete pluralRulesWrapper.pluralRules;
|
||||
}
|
||||
|
||||
if (other.numberFormat == NULL) {
|
||||
numberFormat = NumberFormat::createInstance(locale, status);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user