diff options
author | Andrea Canciani <ranma42@gmail.com> | 2014-12-22 12:49:00 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2015-01-03 14:59:51 +0100 |
commit | 02e4efc961be40d266d4df0acaf3271219529017 (patch) | |
tree | da89d1953a7534a8f7f48be6e16c2aeb3bbbdd91 /src/cairo-font-face.c | |
parent | 028d286e611d46755bb3d1e9932805de2ec35765 (diff) | |
download | cairo-02e4efc961be40d266d4df0acaf3271219529017.tar.gz |
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
Diffstat (limited to 'src/cairo-font-face.c')
-rw-r--r-- | src/cairo-font-face.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c index e32a9bb75..3bcd2a1e6 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 |