diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-01-05 14:21:46 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-01-05 14:47:37 +0100 |
commit | 041a2c827efbf2ed0931426129e38aef9412177f (patch) | |
tree | 0cd5e492fddb901a52825ce7d7e7382ff50b3f67 /source/fitz | |
parent | d521de5ffad2dcc6c151e25373dd8a26a84440eb (diff) | |
download | mupdf-041a2c827efbf2ed0931426129e38aef9412177f.tar.xz |
Separate pdf_drop_annots (that drops lists) and fz_drop_annot.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/document.c | 21 |
1 files changed, 21 insertions, 0 deletions
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) { |