summaryrefslogtreecommitdiff
path: root/source/html
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-07-08 12:04:35 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-07-08 17:21:24 +0200
commit10d6eaa73164b58c91ae8a4537b8a8589038a01d (patch)
tree5b739b0c2202b42a9079ee3ecbd98c3d3b09b124 /source/html
parentb53e7a42f7cc9756ed9fa1fed313271e3ae67855 (diff)
downloadmupdf-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/html')
-rw-r--r--source/html/epub-doc.c10
-rw-r--r--source/html/html-doc.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c
index 408c3345..541fb7eb 100644
--- a/source/html/epub-doc.c
+++ b/source/html/epub-doc.c
@@ -93,7 +93,7 @@ epub_count_pages(fz_context *ctx, fz_document *doc_)
}
static void
-epub_drop_page_imp(fz_context *ctx, fz_page *page_)
+epub_drop_page(fz_context *ctx, fz_page *page_)
{
}
@@ -154,14 +154,14 @@ epub_load_page(fz_context *ctx, fz_document *doc_, int number)
epub_page *page = fz_new_page(ctx, sizeof *page);
page->super.bound_page = epub_bound_page;
page->super.run_page_contents = epub_run_page;
- page->super.drop_page_imp = epub_drop_page_imp;
+ page->super.drop_page = epub_drop_page;
page->doc = doc;
page->number = number;
return (fz_page*)page;
}
static void
-epub_close_document(fz_context *ctx, fz_document *doc_)
+epub_drop_document(fz_context *ctx, fz_document *doc_)
{
epub_document *doc = (epub_document*)doc_;
epub_chapter *ch, *next;
@@ -419,7 +419,7 @@ epub_init(fz_context *ctx, fz_archive *zip)
doc->zip = zip;
doc->set = fz_new_html_font_set(ctx);
- doc->super.close = epub_close_document;
+ doc->super.drop_document = epub_drop_document;
doc->super.layout = epub_layout;
doc->super.load_outline = epub_load_outline;
doc->super.count_pages = epub_count_pages;
@@ -432,7 +432,7 @@ epub_init(fz_context *ctx, fz_archive *zip)
}
fz_catch(ctx)
{
- epub_close_document(ctx, (fz_document*)doc);
+ epub_drop_document(ctx, (fz_document*)doc);
fz_rethrow(ctx);
}
diff --git a/source/html/html-doc.c b/source/html/html-doc.c
index 94ceddb4..2e8b8ec4 100644
--- a/source/html/html-doc.c
+++ b/source/html/html-doc.c
@@ -23,7 +23,7 @@ struct html_page_s
};
static void
-htdoc_close_document(fz_context *ctx, fz_document *doc_)
+htdoc_drop_document(fz_context *ctx, fz_document *doc_)
{
html_document *doc = (html_document*)doc_;
fz_drop_archive(ctx, doc->zip);
@@ -61,7 +61,7 @@ htdoc_layout(fz_context *ctx, fz_document *doc_, float w, float h, float em)
}
static void
-htdoc_drop_page_imp(fz_context *ctx, fz_page *page_)
+htdoc_drop_page(fz_context *ctx, fz_page *page_)
{
}
@@ -97,7 +97,7 @@ htdoc_load_page(fz_context *ctx, fz_document *doc_, int number)
html_page *page = fz_new_page(ctx, sizeof *page);
page->super.bound_page = htdoc_bound_page;
page->super.run_page_contents = htdoc_run_page;
- page->super.drop_page_imp = htdoc_drop_page_imp;
+ page->super.drop_page = htdoc_drop_page;
page->doc = doc;
page->number = number;
return (fz_page*)page;
@@ -119,7 +119,7 @@ htdoc_open_document_with_stream(fz_context *ctx, fz_stream *file)
doc = fz_new_document(ctx, html_document);
- doc->super.close = htdoc_close_document;
+ doc->super.drop_document = htdoc_drop_document;
doc->super.layout = htdoc_layout;
doc->super.count_pages = htdoc_count_pages;
doc->super.load_page = htdoc_load_page;
@@ -145,7 +145,7 @@ htdoc_open_document(fz_context *ctx, const char *filename)
fz_dirname(dirname, filename, sizeof dirname);
doc = fz_new_document(ctx, html_document);
- doc->super.close = htdoc_close_document;
+ doc->super.drop_document = htdoc_drop_document;
doc->super.layout = htdoc_layout;
doc->super.count_pages = htdoc_count_pages;
doc->super.load_page = htdoc_load_page;