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/buffer.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source/fitz/buffer.c') 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); -- cgit v1.2.3