From 1dc763159b03cbd4387713f353f26c890d2c0e52 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 17 Oct 2017 16:41:59 +0200 Subject: Add separate fz_close_output step. Closing flushes output and may throw exceptions. Dropping frees the state and never throws exceptions. --- source/fitz/bitmap.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/fitz/bitmap.c') diff --git a/source/fitz/bitmap.c b/source/fitz/bitmap.c index cee3a3fa..fe16759c 100644 --- a/source/fitz/bitmap.c +++ b/source/fitz/bitmap.c @@ -453,7 +453,10 @@ fz_save_bitmap_as_pbm(fz_context *ctx, fz_bitmap *bitmap, const char *filename) { fz_output *out = fz_new_output_with_path(ctx, filename, 0); fz_try(ctx) + { fz_write_bitmap_as_pbm(ctx, out, bitmap); + fz_close_output(ctx, out); + } fz_always(ctx) fz_drop_output(ctx, out); fz_catch(ctx) @@ -465,7 +468,10 @@ fz_save_bitmap_as_pkm(fz_context *ctx, fz_bitmap *bitmap, const char *filename) { fz_output *out = fz_new_output_with_path(ctx, filename, 0); fz_try(ctx) + { fz_write_bitmap_as_pkm(ctx, out, bitmap); + fz_close_output(ctx, out); + } fz_always(ctx) fz_drop_output(ctx, out); fz_catch(ctx) -- cgit v1.2.3