diff options
Diffstat (limited to 'source/fitz/stream-open.c')
-rw-r--r-- | source/fitz/stream-open.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/fitz/stream-open.c b/source/fitz/stream-open.c index 142df7c2..05cbc48a 100644 --- a/source/fitz/stream-open.c +++ b/source/fitz/stream-open.c @@ -46,18 +46,13 @@ fz_new_stream(fz_context *ctx, void *state, fz_stream_next_fn *next, fz_stream_c fz_stream * fz_keep_stream(fz_context *ctx, fz_stream *stm) { - if (Memento_takeRef(stm)) - stm->refs ++; - return stm; + return fz_keep_imp(ctx, stm, &stm->refs); } void fz_drop_stream(fz_context *ctx, fz_stream *stm) { - if (!Memento_dropRef(stm)) - return; - stm->refs --; - if (stm->refs == 0) + if (fz_drop_imp(ctx, stm, &stm->refs)) { if (stm->close) stm->close(ctx, stm->state); |