diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-07-08 14:24:54 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-07-08 17:21:24 +0200 |
commit | 2be507bfb199e8c80e4b2ee1cb2c867b57fc1f6e (patch) | |
tree | 04544d816acc62b02317b9b58c91a7100330d5b0 /source/fitz/path.c | |
parent | 2791551275e458066b7f1c975d6c8d9e0435051c (diff) | |
download | mupdf-2be507bfb199e8c80e4b2ee1cb2c867b57fc1f6e.tar.xz |
Use fz_keep_imp and fz_drop_imp for all reference counting.
Diffstat (limited to 'source/fitz/path.c')
-rw-r--r-- | source/fitz/path.c | 7 |
1 files changed, 2 insertions, 5 deletions
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; } |