diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-08-04 19:35:39 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2012-08-06 13:59:30 +0200 |
commit | ffb37aaa386095d61846419c860eb46b587b6b1d (patch) | |
tree | 313e382bf77e57062bebd26bfc5ae1dc656eb11e /apps | |
parent | d44c98001b404a18ccc9d219976b9f32c28922c3 (diff) | |
download | mupdf-ffb37aaa386095d61846419c860eb46b587b6b1d.tar.xz |
Make use of fz_always instead of repeating code for error and normal path
Diffstat (limited to 'apps')
-rw-r--r-- | apps/mudraw.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/mudraw.c b/apps/mudraw.c index dcd7dafd..0f11a7a1 100644 --- a/apps/mudraw.c +++ b/apps/mudraw.c @@ -130,15 +130,17 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum) dev = fz_new_list_device(ctx, list); fz_run_page(doc, page, dev, fz_identity, &cookie); } - fz_catch(ctx) + fz_always(ctx) { fz_free_device(dev); + dev = NULL; + } + fz_catch(ctx) + { fz_free_display_list(ctx, list); fz_free_page(doc, page); fz_throw(ctx, "cannot draw page %d in file '%s'", pagenum, filename); } - fz_free_device(dev); - dev = NULL; } if (showxml) |