summaryrefslogtreecommitdiff
path: root/source/fitz/bitmap.c
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/fitz/bitmap.c
parent2791551275e458066b7f1c975d6c8d9e0435051c (diff)
downloadmupdf-2be507bfb199e8c80e4b2ee1cb2c867b57fc1f6e.tar.xz
Use fz_keep_imp and fz_drop_imp for all reference counting.
Diffstat (limited to 'source/fitz/bitmap.c')
-rw-r--r--source/fitz/bitmap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/fitz/bitmap.c b/source/fitz/bitmap.c
index b610737a..dc2645ec 100644
--- a/source/fitz/bitmap.c
+++ b/source/fitz/bitmap.c
@@ -284,15 +284,13 @@ fz_new_bitmap(fz_context *ctx, int w, int h, int n, int xres, int yres)
fz_bitmap *
fz_keep_bitmap(fz_context *ctx, fz_bitmap *bit)
{
- if (bit)
- bit->refs++;
- return bit;
+ return fz_keep_imp(ctx, bit, &bit->refs);
}
void
fz_drop_bitmap(fz_context *ctx, fz_bitmap *bit)
{
- if (bit && --bit->refs == 0)
+ if (fz_drop_imp(ctx, bit, &bit->refs))
{
fz_free(ctx, bit->samples);
fz_free(ctx, bit);