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/output-svg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/fitz/output-svg.c') diff --git a/source/fitz/output-svg.c b/source/fitz/output-svg.c index 7bae9d4f..8895960a 100644 --- a/source/fitz/output-svg.c +++ b/source/fitz/output-svg.c @@ -46,14 +46,18 @@ svg_end_page(fz_context *ctx, fz_document_writer *wri_, fz_device *dev) fz_svg_writer *wri = (fz_svg_writer*)wri_; fz_try(ctx) + { fz_close_device(ctx, dev); + fz_close_output(ctx, wri->out); + } fz_always(ctx) + { fz_drop_device(ctx, dev); + fz_drop_output(ctx, wri->out); + wri->out = NULL; + } fz_catch(ctx) fz_rethrow(ctx); - - fz_drop_output(ctx, wri->out); - wri->out = NULL; } static void -- cgit v1.2.3