summaryrefslogtreecommitdiff
path: root/source/fitz/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/fitz/buffer.c')
-rw-r--r--source/fitz/buffer.c8
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);