From d4c73c65888e422f8b5d5c102ce80f4e82622bfb Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 13 Feb 2012 17:53:21 +0000 Subject: Add locking around freetype calls. We only open one instance of freetype per document. We therefore have to ensure that only 1 call to it takes place at a time. We introduce a lock for this purpose (FZ_LOCK_FREETYPE), and arrange to take/release it as required. We also update the font context so it is properly shared. --- draw/draw_glyph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'draw/draw_glyph.c') diff --git a/draw/draw_glyph.c b/draw/draw_glyph.c index 00eaf460..68ae3b80 100644 --- a/draw/draw_glyph.c +++ b/draw/draw_glyph.c @@ -68,7 +68,7 @@ fz_evict_glyph_cache(fz_context *ctx) } void -fz_free_glyph_cache_context(fz_context *ctx) +fz_drop_glyph_cache_context(fz_context *ctx) { if (!ctx->glyph_cache) return; @@ -86,7 +86,7 @@ fz_free_glyph_cache_context(fz_context *ctx) } fz_glyph_cache * -fz_glyph_cache_keep(fz_context *ctx) +fz_keep_glyph_cache(fz_context *ctx) { fz_lock(ctx, FZ_LOCK_GLYPHCACHE); ctx->glyph_cache->refs++; -- cgit v1.2.3