summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc
index 2c44cf26533..d44d8c91212 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc
@@ -44,8 +44,13 @@ static const hb_shaper_pair_t *static_shapers;
static
void free_static_shapers (void)
{
- if (unlikely (static_shapers != all_shapers))
- free ((void *) static_shapers);
+retry:
+ hb_shaper_pair_t *shapers = (hb_shaper_pair_t *) hb_atomic_ptr_get (&static_shapers);
+ if (!hb_atomic_ptr_cmpexch (&static_shapers, shapers, nullptr))
+ goto retry;
+
+ if (unlikely (shapers != all_shapers))
+ free ((void *) shapers);
}
#endif