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/xps/xps-zip.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/xps/xps-zip.c')
-rw-r--r-- | source/xps/xps-zip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/xps/xps-zip.c b/source/xps/xps-zip.c index b0c4403a..2bf0391f 100644 --- a/source/xps/xps-zip.c +++ b/source/xps/xps-zip.c @@ -134,7 +134,7 @@ xps_open_document_with_directory(fz_context *ctx, const char *directory) } fz_catch(ctx) { - xps_close_document(ctx, doc); + xps_drop_document(ctx, doc); fz_rethrow(ctx); } @@ -156,7 +156,7 @@ xps_open_document_with_stream(fz_context *ctx, fz_stream *file) } fz_catch(ctx) { - xps_close_document(ctx, doc); + xps_drop_document(ctx, doc); fz_rethrow(ctx); } @@ -194,7 +194,7 @@ xps_open_document(fz_context *ctx, const char *filename) } void -xps_close_document(fz_context *ctx, xps_document *doc) +xps_drop_document(fz_context *ctx, xps_document *doc) { xps_font_cache *font, *next; @@ -232,7 +232,7 @@ static void xps_init_document(fz_context *ctx, xps_document *doc) { doc->super.refs = 1; - doc->super.close = (fz_document_close_fn *)xps_close_document; + doc->super.drop_document = (fz_document_drop_fn *)xps_drop_document; doc->super.load_outline = (fz_document_load_outline_fn *)xps_load_outline; doc->super.count_pages = (fz_document_count_pages_fn *)xps_count_pages; doc->super.load_page = (fz_document_load_page_fn *)xps_load_page; |