From 42c414870c1ff69b427eccb1d334c7cfbd1f0731 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 18 Jun 2017 19:10:17 +0800 Subject: Drop document in case of error. --- source/tools/mudraw.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c index 34f9778f..5de7e0a1 100644 --- a/source/tools/mudraw.c +++ b/source/tools/mudraw.c @@ -1715,12 +1715,13 @@ int mudraw_main(int argc, char **argv) } fz_catch(ctx) { + fz_drop_document(ctx, doc); + doc = NULL; + if (!ignore_errors) fz_rethrow(ctx); bgprint_flush(); - fz_drop_document(ctx, doc); - doc = NULL; fz_warn(ctx, "ignoring error in '%s'", filename); } } -- cgit v1.2.3