From 2caa4788e1f26555853e5bf0ba88e39c4711ec00 Mon Sep 17 00:00:00 2001 From: Roland Baer Date: Thu, 16 Aug 2007 12:40:26 +0300 Subject: [PATCH] Added unlocks in cairo-ft-font.c --- src/cairo-ft-font.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index 54a84a9..8f46c73 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -1464,8 +1464,10 @@ _cairo_ft_scaled_font_create (cairo_ft_unscaled_font_t *unscaled, cairo_status_t status; face = _cairo_ft_unscaled_font_lock_face (unscaled); - if (!face) + if (!face) { + _cairo_ft_unscaled_font_unlock_face (unscaled); return NULL; + } scaled_font = malloc (sizeof(cairo_ft_scaled_font_t)); if (scaled_font == NULL) { @@ -2077,8 +2079,10 @@ _cairo_ft_ucs4_to_index (void *abstract_font, FT_UInt index; face = _cairo_ft_unscaled_font_lock_face (unscaled); - if (!face) + if (!face) { + _cairo_ft_unscaled_font_unlock_face (unscaled); return 0; + } index = FT_Get_Char_Index (face, ucs4); _cairo_ft_unscaled_font_unlock_face (unscaled); return index; @@ -2101,9 +2105,10 @@ _cairo_ft_load_truetype_table (void *abstract_font, #if HAVE_FT_LOAD_SFNT_TABLE face = _cairo_ft_unscaled_font_lock_face (unscaled); - if (!face) + if (!face) { + _cairo_ft_unscaled_font_unlock_face (unscaled); return CAIRO_STATUS_NO_MEMORY; - + } if (FT_IS_SFNT (face) && FT_Load_Sfnt_Table (face, tag, offset, buffer, length) == 0) status = CAIRO_STATUS_SUCCESS; -- 1.5.2.4