diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-10-17 16:41:59 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-11-01 13:08:56 +0100 |
commit | 1dc763159b03cbd4387713f353f26c890d2c0e52 (patch) | |
tree | d43c18deeacd70e23d7e353c8f0c074c87419a34 /source/pdf/pdf-write.c | |
parent | f595e889b91a674eb94db7ca4d832da54f5194cd (diff) | |
download | mupdf-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/pdf/pdf-write.c')
-rw-r--r-- | source/pdf/pdf-write.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c index 9f123206..b97a9956 100644 --- a/source/pdf/pdf-write.c +++ b/source/pdf/pdf-write.c @@ -3073,14 +3073,10 @@ void pdf_save_document(fz_context *ctx, pdf_document *doc, const char *filename, { opts.out = fz_new_output_with_path(ctx, filename, 0); } - - if (!opts.out) - fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open output file '%s'", filename); - fz_try(ctx) { do_pdf_save_document(ctx, doc, &opts, in_opts); - + fz_close_output(ctx, opts.out); complete_signatures(ctx, doc, &opts, filename); } fz_always(ctx) |