diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-11 22:39:08 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-14 01:19:07 +0800 |
commit | c3f0d8a4612f25ac3b728d8335c13dc543254be2 (patch) | |
tree | fe54f8e73a4ba87401de8cd5a35446910b484c7f /source/fitz/colorspace.c | |
parent | 160369e81e6675d122b210b45844c0dc86ec8876 (diff) | |
download | mupdf-c3f0d8a4612f25ac3b728d8335c13dc543254be2.tar.xz |
Drop all contexts the same way.
* Handle multiple calls to fz_drop_colorspace_context() and
fz_drop_font_context().
* Allow missing context in call to fz_drop_aa_context()
and fz_drop_glyph_cache_context().
* Only drop font context objects when dropping the last reference.
* Avoid unnecessary NULL checks.
Diffstat (limited to 'source/fitz/colorspace.c')
-rw-r--r-- | source/fitz/colorspace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c index 6313fb70..84e9b36c 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -257,7 +257,10 @@ void fz_drop_colorspace_context(fz_context *ctx) if (!ctx) return; if (fz_drop_imp(ctx, ctx->colorspace, &ctx->colorspace->ctx_refs)) + { fz_free(ctx, ctx->colorspace); + ctx->colorspace = NULL; + } } fz_colorspace * |