diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2017-06-11 23:11:42 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2017-09-07 21:02:53 +0800 |
commit | 8cb0a389794356d7b6624f78365a5e92efdeb8e8 (patch) | |
tree | f05e3442351a46af3e4d5209f8b754c6b33f948f /source/fitz/stext-output.c | |
parent | a27d9903ec238af6e4c1c59de1e1dae817b4f028 (diff) | |
download | mupdf-8cb0a389794356d7b6624f78365a5e92efdeb8e8.tar.xz |
Make sure to always drop a fz_device even upon error.
Diffstat (limited to 'source/fitz/stext-output.c')
-rw-r--r-- | source/fitz/stext-output.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/fitz/stext-output.c b/source/fitz/stext-output.c index 63cd3c17..c2218357 100644 --- a/source/fitz/stext-output.c +++ b/source/fitz/stext-output.c @@ -471,8 +471,13 @@ static void text_end_page(fz_context *ctx, fz_document_writer *wri_, fz_device *dev) { fz_text_writer *wri = (fz_text_writer*)wri_; - fz_close_device(ctx, dev); - fz_drop_device(ctx, dev); + + fz_try(ctx) + fz_close_device(ctx, dev); + fz_always(ctx) + fz_drop_device(ctx, dev); + fz_catch(ctx) + fz_rethrow(ctx); switch (wri->format) { |