X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..8421dd3e84fd555a76b2a7fe24b280f86b8a65b7:/icuSources/i18n/regexst.cpp diff --git a/icuSources/i18n/regexst.cpp b/icuSources/i18n/regexst.cpp index cfc1f7d8..b8ad297d 100644 --- a/icuSources/i18n/regexst.cpp +++ b/icuSources/i18n/regexst.cpp @@ -1,7 +1,7 @@ // // regexst.h // -// Copyright (C) 2004-2008, International Business Machines Corporation and others. +// Copyright (C) 2004-2010, International Business Machines Corporation and others. // All Rights Reserved. // // This file contains class RegexStaticSets @@ -146,7 +146,8 @@ RegexStaticSets *RegexStaticSets::gStaticSets = NULL; RegexStaticSets::RegexStaticSets(UErrorCode *status) : fUnescapeCharSet(UnicodeString(TRUE, gUnescapeCharPattern, -1), *status), -fRuleDigitsAlias(NULL) +fRuleDigitsAlias(NULL), +fEmptyText(NULL) { // First zero out everything int i; @@ -214,6 +215,10 @@ fRuleDigitsAlias(NULL) for (i=0; i<(int32_t)(sizeof(fRuleSets)/sizeof(fRuleSets[0])); i++) { fRuleSets[i].compact(); } + + // Finally, initialize an empty string for utility purposes + fEmptyText = utext_openUChars(NULL, NULL, 0, status); + return; // If we reached this point, everything is fine so just exit ExitConstrDeleteAll: // Remove fPropSets and fRuleSets and return error @@ -233,6 +238,8 @@ RegexStaticSets::~RegexStaticSets() { fPropSets[i] = NULL; } fRuleDigitsAlias = NULL; + + utext_close(fEmptyText); }