summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/tools/pdfinfo.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/tools/pdfinfo.c b/source/tools/pdfinfo.c
index a3a7ba24..cc18a1e1 100644
--- a/source/tools/pdfinfo.c
+++ b/source/tools/pdfinfo.c
@@ -87,14 +87,9 @@ typedef struct globals_s
int psobjs;
} globals;
-static void closexref(fz_context *ctx, globals *glo)
+static void clearinfo(fz_context *ctx, globals *glo)
{
int i;
- if (glo->doc)
- {
- pdf_close_document(ctx, glo->doc);
- glo->doc = NULL;
- }
if (glo->dim)
{
@@ -148,6 +143,17 @@ static void closexref(fz_context *ctx, globals *glo)
}
}
+static void closexref(fz_context *ctx, globals *glo)
+{
+ if (glo->doc)
+ {
+ pdf_close_document(ctx, glo->doc);
+ glo->doc = NULL;
+ }
+
+ clearinfo(ctx, glo);
+}
+
static void
infousage(void)
{
@@ -954,6 +960,7 @@ showinfo(fz_context *ctx, globals *glo, char *filename, int show, char *pagelist
fz_printf(ctx, out, "Page %d:\n", page);
printinfo(ctx, glo, filename, show, page);
fz_printf(ctx, out, "\n");
+ clearinfo(ctx, glo);
}
}