From c53b6af33c996a7ae6815ac15254297d43f43a9c Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Sat, 17 Dec 2011 00:07:09 +0000 Subject: Change stream 'close' functions to facilitate error cleanup. Rather than passing a stream to a close function, just pass context and state - that's all that is required. This enables us to call close to cleanup neatly if the stream fails to allocate. --- fitz/filt_jbig2d.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fitz/filt_jbig2d.c') diff --git a/fitz/filt_jbig2d.c b/fitz/filt_jbig2d.c index e90be9f8..69e3df50 100644 --- a/fitz/filt_jbig2d.c +++ b/fitz/filt_jbig2d.c @@ -29,16 +29,16 @@ struct fz_jbig2d_s }; static void -close_jbig2d(fz_stream *stm) +close_jbig2d(fz_context *ctx, void *state_) { - fz_jbig2d *state = stm->state; + fz_jbig2d *state = (fz_jbig2d *)state_; if (state->page) jbig2_release_page(state->ctx, state->page); if (state->gctx) jbig2_global_ctx_free(state->gctx); jbig2_ctx_free(state->ctx); fz_close(state->chain); - fz_free(stm->ctx, state); + fz_free(ctx, state); } static int -- cgit v1.2.3