diff options
author | Youngbok Shin <youngb.shin@samsung.com> | 2018-06-26 11:15:52 +0900 |
---|---|---|
committer | Youngbok Shin <youngb.shin@samsung.com> | 2018-06-26 11:15:52 +0900 |
commit | b9f425ddd6223cd82b3d35f13fbd060d3c0c0e38 (patch) | |
tree | 87220edcaa6118811d062d77d0562a3f74c7f885 /src/hb-glib.cc | |
parent | 1c272a48507bb3c7905aa30d8bf0d092b474f781 (diff) | |
download | harfbuzz-b9f425ddd6223cd82b3d35f13fbd060d3c0c0e38.tar.gz harfbuzz-b9f425ddd6223cd82b3d35f13fbd060d3c0c0e38.tar.bz2 harfbuzz-b9f425ddd6223cd82b3d35f13fbd060d3c0c0e38.zip |
Imported Upstream version 1.8.1upstream/1.8.1
Diffstat (limited to 'src/hb-glib.cc')
-rw-r--r-- | src/hb-glib.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hb-glib.cc b/src/hb-glib.cc index 50c30e9..246380a 100644 --- a/src/hb-glib.cc +++ b/src/hb-glib.cc @@ -370,7 +370,12 @@ static hb_unicode_funcs_t *static_glib_funcs = nullptr; static void free_static_glib_funcs (void) { - hb_unicode_funcs_destroy (static_glib_funcs); +retry: + hb_unicode_funcs_t *glib_funcs = (hb_unicode_funcs_t *) hb_atomic_ptr_get (&static_glib_funcs); + if (!hb_atomic_ptr_cmpexch (&static_glib_funcs, glib_funcs, nullptr)) + goto retry; + + hb_unicode_funcs_destroy (glib_funcs); } #endif |