Check for scaled_font::cache_frozen in glyph_page_can_remove()

With modifications kindly suggested by Uli Schlachter

Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/587
This commit is contained in:
Luca Bacci 2022-09-04 15:16:21 +02:00
parent 0e27a8046e
commit 166d718099

View file

@ -2703,7 +2703,16 @@ _cairo_scaled_glyph_page_can_remove (const void *closure)
cairo_scaled_font_t *scaled_font;
scaled_font = page->scaled_font;
return CAIRO_MUTEX_TRY_LOCK (scaled_font->mutex);
if (!CAIRO_MUTEX_TRY_LOCK (scaled_font->mutex))
return FALSE;
if (scaled_font->cache_frozen != 0) {
CAIRO_MUTEX_UNLOCK (scaled_font->mutex);
return FALSE;
}
return TRUE;
}
static cairo_status_t