]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/regexst.cpp
ICU-461.17.tar.gz
[apple/icu.git] / icuSources / i18n / regexst.cpp
index cfc1f7d80bb0a1d94b2d79e4157fd465680a0b34..b8ad297d6634e8061b6ee6618527b70edd90b9e1 100644 (file)
@@ -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);
 }