Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion icu4c/source/i18n/collationroot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ static UInitOnce initOnce = U_INITONCE_INITIALIZER;
U_CDECL_BEGIN

static UBool U_CALLCONV uprv_collation_root_cleanup() {
SharedObject::clearPtr(rootSingleton);
// Reset initOnce first so that concurrent getRoot()/getRootCacheEntry()
// callers will block on re-initialization rather than dereferencing
// a rootSingleton that is being (or has been) cleared.
initOnce.reset();
SharedObject::clearPtr(rootSingleton);
return TRUE;
}

Expand Down