mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-13 04:40:38 +01:00
fix double free and failed assertions in cairo_scaled_font_destroy
This commit is contained in:
parent
f896701502
commit
a67735010d
1 changed files with 4 additions and 4 deletions
8
src/cairo-scaled-font.c
Normal file → Executable file
8
src/cairo-scaled-font.c
Normal file → Executable file
|
|
@ -1320,15 +1320,15 @@ cairo_scaled_font_destroy (cairo_scaled_font_t *scaled_font)
|
|||
|
||||
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&scaled_font->ref_count));
|
||||
|
||||
font_map = _cairo_scaled_font_map_lock ();
|
||||
assert (font_map != NULL);
|
||||
|
||||
if (! _cairo_reference_count_dec_and_test (&scaled_font->ref_count))
|
||||
return;
|
||||
goto unlock;
|
||||
|
||||
assert (! scaled_font->cache_frozen);
|
||||
assert (! scaled_font->global_cache_frozen);
|
||||
|
||||
font_map = _cairo_scaled_font_map_lock ();
|
||||
assert (font_map != NULL);
|
||||
|
||||
/* Another thread may have resurrected the font whilst we waited */
|
||||
if (! CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&scaled_font->ref_count)) {
|
||||
if (! scaled_font->placeholder &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue