[cairo-bugs] [Bug 12026] missing unlocks in src/* (font related)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 16 03:29:40 PDT 2007


http://bugs.freedesktop.org/show_bug.cgi?id=12026


chris at chris-wilson.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chris at chris-wilson.co.uk




------- Comment #4 from chris at chris-wilson.co.uk  2007-08-16 03:27 PST -------
Calling _cairo_ft_unscaled_font_unlock_face() after an error encountered during
_cairo_ft_unscaled_font_lock_face() is wrong as the error path within
lock_face() has already released the unscaled->mutex. Error paths are supposed
to perform all necessary cleanup, but reading lock_face() it appears to be
falsely incrementing unscaled->lock_count after an error. (And it looks like
font_map->num_open_faces++ should be using an atomic op instead.)

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 4dc61ee..04441d0 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -552,6 +552,7 @@ _cairo_ft_unscaled_font_lock_face (cairo_ft_unscaled_font_t 
                     unscaled->id,
                     &face) != FT_Err_Ok)
     {
+       unscaled->lock_count--;
        CAIRO_MUTEX_UNLOCK (unscaled->mutex);
        _cairo_error (CAIRO_STATUS_NO_MEMORY);
        return NULL;


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the cairo-bugs mailing list