summaryrefslogtreecommitdiff
path: root/source/gprf
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-07-08 14:24:54 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-07-08 17:21:24 +0200
commit2be507bfb199e8c80e4b2ee1cb2c867b57fc1f6e (patch)
tree04544d816acc62b02317b9b58c91a7100330d5b0 /source/gprf
parent2791551275e458066b7f1c975d6c8d9e0435051c (diff)
downloadmupdf-2be507bfb199e8c80e4b2ee1cb2c867b57fc1f6e.tar.xz
Use fz_keep_imp and fz_drop_imp for all reference counting.
Diffstat (limited to 'source/gprf')
-rw-r--r--source/gprf/gprf-doc.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/source/gprf/gprf-doc.c b/source/gprf/gprf-doc.c
index 3b97d5ae..e7458043 100644
--- a/source/gprf/gprf-doc.c
+++ b/source/gprf/gprf-doc.c
@@ -69,25 +69,16 @@ fz_keep_gprf_file(fz_context *ctx, gprf_file *file)
if (!ctx || !file)
return NULL;
- fz_lock(ctx, FZ_LOCK_ALLOC);
- file->refs++;
- fz_unlock(ctx, FZ_LOCK_ALLOC);
-
- return file;
+ return fz_keep_imp(ctx, file, &file->refs);
}
static void
fz_drop_gprf_file(fz_context *ctx, gprf_file *file)
{
- int i;
-
if (!ctx || !file)
return;
- fz_lock(ctx, FZ_LOCK_ALLOC);
- i = --file->refs;
- fz_unlock(ctx, FZ_LOCK_ALLOC);
- if (i == 0)
+ if (fz_drop_imp(ctx, file, &file->refs))
{
unlink(file->filename);
fz_free(ctx, file->filename);