summaryrefslogtreecommitdiff
path: root/source/fitz/stext-output.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/fitz/stext-output.c')
-rw-r--r--source/fitz/stext-output.c9
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)
{