summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/image/pdftoepdf.w')
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.w8
1 files changed, 7 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
index 09dcd251584..7ba29731c19 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
@@ -693,7 +693,7 @@ void read_pdf_info(image_dict * idict)
unrefPdfDocument(img_filepath(idict));
}
- and also unref'd in the finalizer zo we got an extra unrefs when garbage was
+ and also unref'd in the finalizer so we got an extra unrefs when garbage was
collected. However it is more efficient to keep the file open so we do that
now. The (slower) alternative is to unref here (which in most cases forcing a
close of the file) but then we must not call flush_pdf_info.
@@ -893,6 +893,12 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
unrefPdfDocument(img_filepath(idict));
*/
+
+if (! img_keepopen(idict)) {
+ unrefPdfDocument(img_filepath(idict));
+}
+
+
}
/* Deallocate a PdfDocument with all its resources. */