[font] Comments

This commit is contained in:
Behdad Esfahbod 2023-01-28 22:18:53 -07:00
parent 544dd9678c
commit 5da829eaf5
1 changed files with 5 additions and 3 deletions

View File

@ -85,6 +85,7 @@ _hb_ot_font_create (hb_font_t *font)
ot_font->ot_face = &font->face->table; ot_font->ot_face = &font->face->table;
// retry:
auto *cmap_cache = (hb_ot_font_cmap_cache_t *) hb_face_get_user_data (font->face, auto *cmap_cache = (hb_ot_font_cmap_cache_t *) hb_face_get_user_data (font->face,
&hb_ot_font_cmap_cache_user_data_key); &hb_ot_font_cmap_cache_user_data_key);
if (!cmap_cache) if (!cmap_cache)
@ -98,13 +99,14 @@ _hb_ot_font_create (hb_font_t *font)
hb_free, hb_free,
false))) false)))
{ {
/* Normally we would retry after this, but that would hb_free (cmap_cache);
cmap_cache = nullptr;
/* Normally we would retry here, but that would
* infinite-loop if the face is the empty-face. * infinite-loop if the face is the empty-face.
* Just let it go and this font will be uncached if it * Just let it go and this font will be uncached if it
* happened to collide with another thread creating the * happened to collide with another thread creating the
* cache at the same time. */ * cache at the same time. */
hb_free (cmap_cache); // goto retry;
cmap_cache = nullptr;
} }
} }
out: out: