[cairo-commit] 2 commits - src/cairo-scaled-font.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 5 20:21:40 UTC 2022


 src/cairo-scaled-font.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit a7d31a8714fc5fa8ba78536be687dd9625c2cbba
Merge: 0e27a8046 166d71809
Author: Uli Schlachter <psychon at znc.in>
Date:   Mon Sep 5 20:21:38 2022 +0000

    Merge branch 'fix-issue-587' into 'master'
    
    Check for cache not frozen in glyph_page_can_remove()
    
    Closes #587
    
    See merge request cairo/cairo!355

commit 166d718099fc8898895d4ad2839d5fb9865a87a5
Author: Luca Bacci <luca.bacci982 at gmail.com>
Date:   Sun Sep 4 15:16:21 2022 +0200

    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

diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 5fe81110f..7d556036e 100755
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -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


More information about the cairo-commit mailing list