font: Actually perform destruction of fonts

Commit 337ab1f8d9 introduced delayed
font destruction to overcome a race, but prevented the correct cleanup
of the font cache.

This caused fonts to stay in the cache and caused a crash in the
api-special-cases (when running the test suite with -f).

Fixes api-special-cases,
https://bugs.freedesktop.org/show_bug.cgi?id=87567
This commit is contained in:
Andrea Canciani 2014-12-22 12:49:00 +01:00
parent 028d286e61
commit 02e4efc961

View file

@ -128,7 +128,8 @@ cairo_font_face_reference (cairo_font_face_t *font_face)
}
slim_hidden_def (cairo_font_face_reference);
static inline int __put(cairo_reference_count_t *v)
static inline cairo_bool_t
__put(cairo_reference_count_t *v)
{
int c, old;
@ -136,7 +137,7 @@ static inline int __put(cairo_reference_count_t *v)
while (c != 1 && (old = _cairo_atomic_int_cmpxchg_return_old(&v->ref_count, c, c - 1)) != c)
c = old;
return c;
return c != 1;
}
cairo_bool_t