From 10d6eaa73164b58c91ae8a4537b8a8589038a01d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 8 Jul 2016 12:04:35 +0200 Subject: 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). --- source/xps/xps-zip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/xps/xps-zip.c') 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; -- cgit v1.2.3