]> granicus.if.org Git - icu/commit
ICU-21662 UVector cleanup in rbtz.cpp
authorAndy Heninger <andy.heninger@gmail.com>
Wed, 15 Sep 2021 21:51:48 +0000 (14:51 -0700)
committerAndy Heninger <andy.heninger@gmail.com>
Tue, 21 Sep 2021 23:29:51 +0000 (16:29 -0700)
commit35dff23fb54a3566d19bc864a3ca4b5f308145eb
treee3c2cf87cda09e694f7d3a76426b18b0f4a9bc88
parentb2c1dffb70b40e9c16bf667b5e22463bcf837a14
ICU-21662 UVector cleanup in rbtz.cpp

Revise uses of UVector in rbtz.cpp 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 include

- Use LocalPointers and UVector deleter functions to simplify OOM checking and recovery.
- Fix RuleBasedTimeZone::addTransitionRule(rule) to have standard ICU adopt behavior
  when errors occur, meaning automatic deletion of the incoming rule. This simplifies
  both the implementation of the function and the code at the call sites.
- Update addTransitionRule() call sites. Includes modifying the Dangi calendar initializtion
  to not silently ignore errors.
- struct Transition is changed to derive from UMemory, which allows the use of LocalPointers.
icu4c/source/i18n/dangical.cpp
icu4c/source/i18n/dangical.h
icu4c/source/i18n/rbtz.cpp
icu4c/source/i18n/unicode/rbtz.h
icu4c/source/i18n/vtzone.cpp
icu4c/source/test/intltest/tzrulets.cpp