From 041a2c827efbf2ed0931426129e38aef9412177f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 5 Jan 2016 14:21:46 +0100 Subject: Separate pdf_drop_annots (that drops lists) and fz_drop_annot. --- source/fitz/document.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source/fitz/document.c') diff --git a/source/fitz/document.c b/source/fitz/document.c index b902161c..319ac83b 100644 --- a/source/fitz/document.c +++ b/source/fitz/document.c @@ -369,6 +369,27 @@ fz_new_annot(fz_context *ctx, int size) return page; } +fz_annot * +fz_keep_annot(fz_context *ctx, fz_annot *annot) +{ + if (annot) + ++annot->refs; + return annot; +} + +void +fz_drop_annot(fz_context *ctx, fz_annot *annot) +{ + if (annot) + { + if (--annot->refs == 0 && annot->drop_annot_imp) + { + annot->drop_annot_imp(ctx, annot); + fz_free(ctx, annot); + } + } +} + void * fz_new_page(fz_context *ctx, int size) { -- cgit v1.2.3