From 2be507bfb199e8c80e4b2ee1cb2c867b57fc1f6e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 8 Jul 2016 14:24:54 +0200 Subject: Use fz_keep_imp and fz_drop_imp for all reference counting. --- source/fitz/path.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'source/fitz/path.c') diff --git a/source/fitz/path.c b/source/fitz/path.c index 0fce853b..3befcf23 100644 --- a/source/fitz/path.c +++ b/source/fitz/path.c @@ -1494,7 +1494,7 @@ fz_clone_stroke_state(fz_context *ctx, fz_stroke_state *stroke) fz_stroke_state * fz_unshare_stroke_state_with_dash_len(fz_context *ctx, fz_stroke_state *shared, int len) { - int single, unsize, shsize, shlen, drop; + int single, unsize, shsize, shlen; fz_stroke_state *unshared; fz_lock(ctx, FZ_LOCK_ALLOC); @@ -1516,10 +1516,7 @@ fz_unshare_stroke_state_with_dash_len(fz_context *ctx, fz_stroke_state *shared, memcpy(unshared, shared, (shsize > unsize ? unsize : shsize)); unshared->refs = 1; - fz_lock(ctx, FZ_LOCK_ALLOC); - drop = (shared->refs > 0 ? --shared->refs == 0 : 0); - fz_unlock(ctx, FZ_LOCK_ALLOC); - if (drop) + if (fz_drop_imp(ctx, shared, &shared->refs)) fz_free(ctx, shared); return unshared; } -- cgit v1.2.3