diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-12-17 00:07:09 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-12-17 00:07:09 +0000 |
commit | c53b6af33c996a7ae6815ac15254297d43f43a9c (patch) | |
tree | fb3a9d65ec564cacc60d8a59b2310867ae0926cb /fitz/filt_predict.c | |
parent | 6888c5757779610c9da201e34b70c1800b898616 (diff) | |
download | mupdf-c53b6af33c996a7ae6815ac15254297d43f43a9c.tar.xz |
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.
Diffstat (limited to 'fitz/filt_predict.c')
-rw-r--r-- | fitz/filt_predict.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fitz/filt_predict.c b/fitz/filt_predict.c index 72b91439..ab4a2eaa 100644 --- a/fitz/filt_predict.c +++ b/fitz/filt_predict.c @@ -177,14 +177,14 @@ read_predict(fz_stream *stm, unsigned char *buf, int len) } static void -close_predict(fz_stream *stm) +close_predict(fz_context *ctx, void *state_) { - fz_predict *state = stm->state; + fz_predict *state = (fz_predict *)state_; fz_close(state->chain); - fz_free(stm->ctx, state->in); - fz_free(stm->ctx, state->out); - fz_free(stm->ctx, state->ref); - fz_free(stm->ctx, state); + fz_free(ctx, state->in); + fz_free(ctx, state->out); + fz_free(ctx, state->ref); + fz_free(ctx, state); } fz_stream * |