diff options
Diffstat (limited to 'source/fitz/output-cbz.c')
-rw-r--r-- | source/fitz/output-cbz.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/fitz/output-cbz.c b/source/fitz/output-cbz.c index 68a71fed..0abeb1a4 100644 --- a/source/fitz/output-cbz.c +++ b/source/fitz/output-cbz.c @@ -31,8 +31,12 @@ cbz_end_page(fz_context *ctx, fz_document_writer *wri_, fz_device *dev) fz_buffer *buffer; char name[40]; - 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); wri->count += 1; @@ -111,8 +115,12 @@ pixmap_end_page(fz_context *ctx, fz_document_writer *wri_, fz_device *dev) fz_pixmap_writer *wri = (fz_pixmap_writer*)wri_; char path[PATH_MAX]; - 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); wri->count += 1; |