summaryrefslogtreecommitdiff
path: root/deps/icu-small/source/common/ucnv_bld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'deps/icu-small/source/common/ucnv_bld.cpp')
-rw-r--r--deps/icu-small/source/common/ucnv_bld.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/deps/icu-small/source/common/ucnv_bld.cpp b/deps/icu-small/source/common/ucnv_bld.cpp
index 482034fd0c..1a1625d69c 100644
--- a/deps/icu-small/source/common/ucnv_bld.cpp
+++ b/deps/icu-small/source/common/ucnv_bld.cpp
@@ -261,6 +261,11 @@ static UBool U_CALLCONV ucnv_cleanup(void) {
return (SHARED_DATA_HASHTABLE == NULL);
}
+U_CAPI void U_EXPORT2
+ucnv_enableCleanup() {
+ ucln_common_registerCleanup(UCLN_COMMON_UCNV, ucnv_cleanup);
+}
+
static UBool U_CALLCONV
isCnvAcceptable(void * /*context*/,
const char * /*type*/, const char * /*name*/,
@@ -439,7 +444,7 @@ ucnv_shareConverterData(UConverterSharedData * data)
SHARED_DATA_HASHTABLE = uhash_openSize(uhash_hashChars, uhash_compareChars, NULL,
ucnv_io_countKnownConverters(&err)*UCNV_CACHE_LOAD_FACTOR,
&err);
- ucln_common_registerCleanup(UCLN_COMMON_UCNV, ucnv_cleanup);
+ ucnv_enableCleanup();
if (U_FAILURE(err))
return;
@@ -1099,7 +1104,7 @@ static void U_CALLCONV initAvailableConvertersList(UErrorCode &errCode) {
U_ASSERT(gAvailableConverterCount == 0);
U_ASSERT(gAvailableConverters == NULL);
- ucln_common_registerCleanup(UCLN_COMMON_UCNV, ucnv_cleanup);
+ ucnv_enableCleanup();
UEnumeration *allConvEnum = ucnv_openAllNames(&errCode);
int32_t allConverterCount = uenum_count(allConvEnum, &errCode);
if (U_FAILURE(errCode)) {
@@ -1205,7 +1210,7 @@ internalSetName(const char *name, UErrorCode *status) {
// -- Andy
gDefaultConverterName = gDefaultConverterNameBuffer;
- ucln_common_registerCleanup(UCLN_COMMON_UCNV, ucnv_cleanup);
+ ucnv_enableCleanup();
umtx_unlock(&cnvCacheMutex);
}