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/buffer.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/buffer.c')
-rw-r--r-- | source/fitz/buffer.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/fitz/buffer.c b/source/fitz/buffer.c index 190088e3..ba3451bf 100644 --- a/source/fitz/buffer.c +++ b/source/fitz/buffer.c @@ -90,17 +90,13 @@ fz_new_buffer_from_base64(fz_context *ctx, const char *data, size_t size) fz_buffer * fz_keep_buffer(fz_context *ctx, fz_buffer *buf) { - if (buf) - buf->refs ++; - return buf; + return fz_keep_imp(ctx, buf, &buf->refs); } void fz_drop_buffer(fz_context *ctx, fz_buffer *buf) { - if (!buf) - return; - if (--buf->refs == 0) + if (fz_drop_imp(ctx, buf, &buf->refs)) { if (!buf->shared) fz_free(ctx, buf->data); |