]> granicus.if.org Git - icu/commit
ICU-21763 UVector cleanup in Locale & Region Code
authorAndy Heninger <andy.heninger@gmail.com>
Tue, 9 Nov 2021 20:53:59 +0000 (12:53 -0800)
committerAndy Heninger <andy.heninger@gmail.com>
Fri, 12 Nov 2021 00:06:36 +0000 (16:06 -0800)
commitc48f218600303630ef7761104b1226655227af56
treea70ed21f84cf5a7f1a678ff87c748873868fe08d
parentd3a56c5ceda272054e7c6bf7e62b4b51367eecf5
ICU-21763 UVector cleanup in Locale & Region Code

Revise uses of UVector in Locale and Region related code to better handle
memory allocation failures.  This is one of an ongoing series of commits to
address similar problems with UVector usage throughout ICU.

The changes involve switching uses of UVector::addElementX() to the new
adoptElement() or addElement() functions, as appropriate, and using
LocalPointers for tracking memory ownership.

In Region::loadRegionData(), improved the overall error detection and recovery.
icu4c/source/common/localematcher.cpp
icu4c/source/common/locid.cpp
icu4c/source/i18n/region.cpp
icu4c/source/i18n/region_impl.h