From d191d5ec55783507f738f1cf3f3fb15a63de1cf4 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Mon, 22 Dec 2014 12:49:00 +0100 Subject: [PATCH] font: Actually perform destruction of fonts Commit 337ab1f8d9e29086bfb4001508b28835b41c6390 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 --- src/cairo-font-face.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c index e32a9bb..3bcd2a1 100644 --- a/src/cairo-font-face.c +++ b/src/cairo-font-face.c @@ -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 -- 1.9.3 (Apple Git-50)