summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mupdf/pdf/document.h4
-rw-r--r--source/pdf/pdf-clean-file.c2
-rw-r--r--source/pdf/pdf-xref.c8
-rw-r--r--source/tools/mudraw.c2
-rw-r--r--source/tools/pdfcreate.c2
-rw-r--r--source/tools/pdfextract.c2
-rw-r--r--source/tools/pdfinfo.c2
-rw-r--r--source/tools/pdfpages.c4
-rw-r--r--source/tools/pdfposter.c2
-rw-r--r--source/tools/pdfshow.c2
10 files changed, 18 insertions, 12 deletions
diff --git a/include/mupdf/pdf/document.h b/include/mupdf/pdf/document.h
index de7df553..5051349f 100644
--- a/include/mupdf/pdf/document.h
+++ b/include/mupdf/pdf/document.h
@@ -87,14 +87,14 @@ pdf_document *pdf_open_document(fz_context *ctx, const char *filename);
pdf_document *pdf_open_document_with_stream(fz_context *ctx, fz_stream *file);
/*
- pdf_close_document: Closes and frees an opened PDF document.
+ pdf_drop_document: Closes and frees an opened PDF document.
The resource store in the context associated with pdf_document
is emptied.
Does not throw exceptions.
*/
-void pdf_close_document(fz_context *ctx, pdf_document *doc);
+void pdf_drop_document(fz_context *ctx, pdf_document *doc);
/*
pdf_specific: down-cast an fz_document to a pdf_document.
diff --git a/source/pdf/pdf-clean-file.c b/source/pdf/pdf-clean-file.c
index b766af89..587f70b6 100644
--- a/source/pdf/pdf-clean-file.c
+++ b/source/pdf/pdf-clean-file.c
@@ -355,7 +355,7 @@ void pdf_clean_file(fz_context *ctx, char *infile, char *outfile, char *password
}
fz_always(ctx)
{
- pdf_close_document(ctx, glo.doc);
+ pdf_drop_document(ctx, glo.doc);
}
fz_catch(ctx)
{
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 02e68530..4456c741 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -1573,7 +1573,7 @@ pdf_init_document(fz_context *ctx, pdf_document *doc)
fz_catch(ctx) { }
}
-void
+static void
pdf_close_document(fz_context *ctx, pdf_document *doc)
{
int i;
@@ -1632,6 +1632,12 @@ pdf_close_document(fz_context *ctx, pdf_document *doc)
}
void
+pdf_drop_document(fz_context *ctx, pdf_document *doc)
+{
+ fz_drop_document(ctx, &doc->super);
+}
+
+void
pdf_print_xref(fz_context *ctx, pdf_document *doc)
{
int i;
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
index da9d7d0f..56bf0f8d 100644
--- a/source/tools/mudraw.c
+++ b/source/tools/mudraw.c
@@ -1134,7 +1134,7 @@ int mudraw_main(int argc, char **argv)
if (!output)
output = "out.pdf";
pdf_save_document(ctx, pdfout, output, NULL);
- pdf_close_document(ctx, pdfout);
+ pdf_drop_document(ctx, pdfout);
}
if (output_format == OUT_HTML)
diff --git a/source/tools/pdfcreate.c b/source/tools/pdfcreate.c
index f8e301a3..47572d7d 100644
--- a/source/tools/pdfcreate.c
+++ b/source/tools/pdfcreate.c
@@ -178,7 +178,7 @@ int pdfcreate_main(int argc, char **argv)
pdf_save_document(ctx, doc, output, &opts);
- pdf_close_document(ctx, doc);
+ pdf_drop_document(ctx, doc);
fz_flush_warnings(ctx);
fz_drop_context(ctx);
diff --git a/source/tools/pdfextract.c b/source/tools/pdfextract.c
index e867ca04..74b3654e 100644
--- a/source/tools/pdfextract.c
+++ b/source/tools/pdfextract.c
@@ -229,7 +229,7 @@ int pdfextract_main(int argc, char **argv)
}
}
- pdf_close_document(ctx, doc);
+ pdf_drop_document(ctx, doc);
fz_flush_warnings(ctx);
fz_drop_context(ctx);
return 0;
diff --git a/source/tools/pdfinfo.c b/source/tools/pdfinfo.c
index 6133e7f5..da500f04 100644
--- a/source/tools/pdfinfo.c
+++ b/source/tools/pdfinfo.c
@@ -147,7 +147,7 @@ static void closexref(fz_context *ctx, globals *glo)
{
if (glo->doc)
{
- pdf_close_document(ctx, glo->doc);
+ pdf_drop_document(ctx, glo->doc);
glo->doc = NULL;
}
diff --git a/source/tools/pdfpages.c b/source/tools/pdfpages.c
index 9f688ac5..f13b5541 100644
--- a/source/tools/pdfpages.c
+++ b/source/tools/pdfpages.c
@@ -178,7 +178,7 @@ pdfpages_pages(fz_context *ctx, fz_output *out, char *filename, char *password,
showpages(ctx, doc, out, "1-");
}
- pdf_close_document(ctx, doc);
+ pdf_drop_document(ctx, doc);
filename = argv[argidx];
fz_printf(ctx, out, "%s:\n", filename);
@@ -201,7 +201,7 @@ pdfpages_pages(fz_context *ctx, fz_output *out, char *filename, char *password,
if (state == NO_INFO_GATHERED)
showpages(ctx, doc, out, "1-");
- pdf_close_document(ctx, doc);
+ pdf_drop_document(ctx, doc);
return ret;
}
diff --git a/source/tools/pdfposter.c b/source/tools/pdfposter.c
index 8989e2c9..a598fb21 100644
--- a/source/tools/pdfposter.c
+++ b/source/tools/pdfposter.c
@@ -205,7 +205,7 @@ int pdfposter_main(int argc, char **argv)
pdf_save_document(ctx, doc, outfile, &opts);
- pdf_close_document(ctx, doc);
+ pdf_drop_document(ctx, doc);
fz_drop_context(ctx);
return 0;
}
diff --git a/source/tools/pdfshow.c b/source/tools/pdfshow.c
index ba560fc8..e84a9393 100644
--- a/source/tools/pdfshow.c
+++ b/source/tools/pdfshow.c
@@ -278,7 +278,7 @@ int pdfshow_main(int argc, char **argv)
}
fz_drop_output(ctx, out);
- pdf_close_document(ctx, doc);
+ pdf_drop_document(ctx, doc);
fz_drop_context(ctx);
return 0;
}