diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-07-08 12:04:35 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-07-08 17:21:24 +0200 |
commit | 10d6eaa73164b58c91ae8a4537b8a8589038a01d (patch) | |
tree | 5b739b0c2202b42a9079ee3ecbd98c3d3b09b124 /source/pdf/pdf-xref.c | |
parent | b53e7a42f7cc9756ed9fa1fed313271e3ae67855 (diff) | |
download | mupdf-10d6eaa73164b58c91ae8a4537b8a8589038a01d.tar.xz |
Separate close and drop functionality for devices and writers.
Closing a device or writer may throw exceptions, but much of the
foreign language bindings (JNI and JS) depend on drop to never throw
an exception (exceptions in finalizers are bad).
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r-- | source/pdf/pdf-xref.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 48a5d316..f9f2f576 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -1556,7 +1556,7 @@ pdf_init_document(fz_context *ctx, pdf_document *doc) } static void -pdf_close_document(fz_context *ctx, pdf_document *doc) +pdf_drop_document_imp(fz_context *ctx, pdf_document *doc) { int i; @@ -2299,7 +2299,7 @@ pdf_new_document(fz_context *ctx, fz_stream *file) { pdf_document *doc = fz_new_document(ctx, pdf_document); - doc->super.close = (fz_document_close_fn *)pdf_close_document; + doc->super.drop_document = (fz_document_drop_fn *)pdf_drop_document_imp; doc->super.needs_password = (fz_document_needs_password_fn *)pdf_needs_password; doc->super.authenticate_password = (fz_document_authenticate_password_fn *)pdf_authenticate_password; doc->super.has_permission = (fz_document_has_permission_fn *)pdf_has_permission; @@ -2325,7 +2325,7 @@ pdf_open_document_with_stream(fz_context *ctx, fz_stream *file) } fz_catch(ctx) { - pdf_close_document(ctx, doc); + pdf_drop_document_imp(ctx, doc); fz_rethrow(ctx); } return doc; @@ -2352,7 +2352,7 @@ pdf_open_document(fz_context *ctx, const char *filename) } fz_catch(ctx) { - pdf_close_document(ctx, doc); + pdf_drop_document_imp(ctx, doc); fz_rethrow(ctx); } return doc; |