mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-5955 Add deleter for TimeZoneRule.
X-SVN-Rev: 24116
This commit is contained in:
parent
ef6684309b
commit
8d8b77b563
1 changed files with 11 additions and 0 deletions
|
@ -20,6 +20,14 @@
|
|||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
// This is the deleter that will be use to remove TimeZoneRule
|
||||
U_CDECL_BEGIN
|
||||
static void U_CALLCONV
|
||||
deleteTimeZoneRule(void* obj) {
|
||||
delete (TimeZoneRule*) obj;
|
||||
}
|
||||
U_CDECL_END
|
||||
|
||||
// Smybol characters used by RFC2445 VTIMEZONE
|
||||
static const UChar COLON = 0x3A; /* : */
|
||||
static const UChar SEMICOLON = 0x3B; /* ; */
|
||||
|
@ -1335,6 +1343,9 @@ VTimeZone::parse(UErrorCode& status) {
|
|||
if (U_FAILURE(status)) {
|
||||
goto cleanupParse;
|
||||
}
|
||||
// Set the deleter to remove TimeZoneRule vectors to avoid memory leaks due to unowned TimeZoneRules.
|
||||
rules->setDeleter(deleteTimeZoneRule);
|
||||
|
||||
dates = new UVector(uhash_deleteUnicodeString, uhash_compareUnicodeString, status);
|
||||
if (U_FAILURE(status)) {
|
||||
goto cleanupParse;
|
||||
|
|
Loading…
Add table
Reference in a new issue