summaryrefslogtreecommitdiff
path: root/source/tools/pdfshow.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-10-17 16:41:59 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-11-01 13:08:56 +0100
commit1dc763159b03cbd4387713f353f26c890d2c0e52 (patch)
treed43c18deeacd70e23d7e353c8f0c074c87419a34 /source/tools/pdfshow.c
parentf595e889b91a674eb94db7ca4d832da54f5194cd (diff)
downloadmupdf-1dc763159b03cbd4387713f353f26c890d2c0e52.tar.xz
Add separate fz_close_output step.
Closing flushes output and may throw exceptions. Dropping frees the state and never throws exceptions.
Diffstat (limited to 'source/tools/pdfshow.c')
-rw-r--r--source/tools/pdfshow.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/source/tools/pdfshow.c b/source/tools/pdfshow.c
index 0ae0fce7..c0358034 100644
--- a/source/tools/pdfshow.c
+++ b/source/tools/pdfshow.c
@@ -231,23 +231,12 @@ fz_print_outline(fz_context *ctx, fz_output *out, fz_outline *outline, int level
static void showoutline(void)
{
fz_outline *outline = fz_load_outline(ctx, (fz_document*)doc);
- fz_output *out = NULL;
-
- fz_var(out);
fz_try(ctx)
- {
- out = fz_stdout(ctx);
- fz_print_outline(ctx, out, outline, 0);
- }
+ fz_print_outline(ctx, fz_stdout(ctx), outline, 0);
fz_always(ctx)
- {
- fz_drop_output(ctx, out);
fz_drop_outline(ctx, outline);
- }
fz_catch(ctx)
- {
fz_rethrow(ctx);
- }
}
int pdfshow_main(int argc, char **argv)
@@ -311,6 +300,8 @@ int pdfshow_main(int argc, char **argv)
}
fz_optind++;
}
+
+ fz_close_output(ctx, out);
}
fz_catch(ctx)
{