diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-03-30 16:39:36 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-03-30 18:18:00 +0100 |
commit | 9ccdd63f008d865b87e9f55b24a0276670844786 (patch) | |
tree | 64f2ccb5a33c08b0b13e89b2a70c5e5f491ea229 /source/pdf/pdf-xref.c | |
parent | f863e1ad7ecf0e67db5906f9562682a2e7ae7b5f (diff) | |
download | mupdf-9ccdd63f008d865b87e9f55b24a0276670844786.tar.xz |
Use fz_new_document for pdf and html docs.
In particular for html docs we were getting the refcount wrong,
causing us to leak on closedown.
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r-- | source/pdf/pdf-xref.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index f8711d3c..6eca8a74 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -2325,9 +2325,8 @@ pdf_page_presentation(fz_context *ctx, pdf_page *page, float *duration) static pdf_document * pdf_new_document(fz_context *ctx, fz_stream *file) { - pdf_document *doc = fz_malloc_struct(ctx, pdf_document); + pdf_document *doc = fz_new_document(ctx, sizeof *doc); - doc->super.refs = 1; doc->super.close = (fz_document_close_fn *)pdf_close_document; doc->super.needs_password = (fz_document_needs_password_fn *)pdf_needs_password; doc->super.authenticate_password = (fz_document_authenticate_password_fn *)pdf_authenticate_password; |