summaryrefslogtreecommitdiff
path: root/deps/icu-small/source/i18n/tridpars.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'deps/icu-small/source/i18n/tridpars.cpp')
-rw-r--r--deps/icu-small/source/i18n/tridpars.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/deps/icu-small/source/i18n/tridpars.cpp b/deps/icu-small/source/i18n/tridpars.cpp
index cbfdf03c42..eb6c6bbba3 100644
--- a/deps/icu-small/source/i18n/tridpars.cpp
+++ b/deps/icu-small/source/i18n/tridpars.cpp
@@ -50,10 +50,7 @@ static UInitOnce gSpecialInversesInitOnce = U_INITONCE_INITIALIZER;
/**
* The mutex controlling access to SPECIAL_INVERSES
*/
-static UMutex *LOCK() {
- static UMutex m = U_MUTEX_INITIALIZER;
- return &m;
-}
+static UMutex LOCK;
TransliteratorIDParser::Specs::Specs(const UnicodeString& s, const UnicodeString& t,
const UnicodeString& v, UBool sawS,
@@ -297,6 +294,7 @@ UnicodeSet* TransliteratorIDParser::parseGlobalFilter(const UnicodeString& id, i
pos = ppos.getIndex();
if (withParens == 1 && !ICU_Utility::parseChar(id, pos, CLOSE_REV)) {
+ delete filter;
pos = start;
return NULL;
}
@@ -662,7 +660,7 @@ void TransliteratorIDParser::registerSpecialInverse(const UnicodeString& target,
bidirectional = FALSE;
}
- Mutex lock(LOCK());
+ Mutex lock(&LOCK);
UnicodeString *tempus = new UnicodeString(inverseTarget); // Used for null pointer check before usage.
if (tempus == NULL) {
@@ -866,9 +864,9 @@ TransliteratorIDParser::specsToSpecialInverse(const Specs& specs, UErrorCode &st
UnicodeString* inverseTarget;
- umtx_lock(LOCK());
+ umtx_lock(&LOCK);
inverseTarget = (UnicodeString*) SPECIAL_INVERSES->get(specs.target);
- umtx_unlock(LOCK());
+ umtx_unlock(&LOCK);
if (inverseTarget != NULL) {
// If the original ID contained "Any-" then make the