summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2017-03-20 16:57:33 -0400
committerRobin Watts <Robin.Watts@artifex.com>2017-03-20 17:11:50 -0400
commit87b0a4d253ab1549b351389f658238fe32a28da1 (patch)
treecf5339c58dd4f3eb4ccccb05567362322d82a22f /source/fitz
parent19773c2cd9fd554ba2a2ce188a4f550cbdc2fa39 (diff)
downloadmupdf-87b0a4d253ab1549b351389f658238fe32a28da1.tar.xz
Remove fz_drop_image_base.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/image.c21
-rw-r--r--source/fitz/store.c5
2 files changed, 9 insertions, 17 deletions
diff --git a/source/fitz/image.c b/source/fitz/image.c
index 58cd876d..261c9f09 100644
--- a/source/fitz/image.c
+++ b/source/fitz/image.c
@@ -109,7 +109,12 @@ static fz_store_type fz_image_store_type =
void
fz_drop_image(fz_context *ctx, fz_image *image)
{
- fz_drop_key_storable(ctx, &image->key_storable);
+ if (fz_drop_key_storable(ctx, &image->key_storable))
+ {
+ fz_drop_colorspace(ctx, image->colorspace);
+ fz_drop_image(ctx, image->mask);
+ fz_free(ctx, image);
+ }
}
static void
@@ -373,17 +378,6 @@ fz_drop_image_imp(fz_context *ctx, fz_storable *image_)
image->drop_image(ctx, image);
}
-void
-fz_drop_image_base(fz_context *ctx, fz_image *image)
-{
- if (!image)
- return;
-
- fz_drop_colorspace(ctx, image->colorspace);
- fz_drop_image(ctx, image->mask);
- fz_free(ctx, image);
-}
-
static void
drop_compressed_image(fz_context *ctx, fz_image *image_)
{
@@ -391,7 +385,6 @@ drop_compressed_image(fz_context *ctx, fz_image *image_)
fz_drop_pixmap(ctx, image->tile);
fz_drop_compressed_buffer(ctx, image->buffer);
- fz_drop_image_base(ctx, &image->super);
}
static void
@@ -400,7 +393,6 @@ drop_pixmap_image(fz_context *ctx, fz_image *image_)
fz_pixmap_image *image = (fz_pixmap_image *)image_;
fz_drop_pixmap(ctx, image->tile);
- fz_drop_image_base(ctx, &image->super);
}
static fz_pixmap *
@@ -1089,7 +1081,6 @@ static void drop_display_list_image(fz_context *ctx, fz_image *image_)
if (image == NULL)
return;
fz_drop_display_list(ctx, image->list);
- fz_drop_image_base(ctx, &image->super);
}
static size_t
diff --git a/source/fitz/store.c b/source/fitz/store.c
index b3996686..620bf0ea 100644
--- a/source/fitz/store.c
+++ b/source/fitz/store.c
@@ -168,7 +168,7 @@ do_reap(fz_context *ctx)
}
}
-void fz_drop_key_storable(fz_context *ctx, const fz_key_storable *sc)
+int fz_drop_key_storable(fz_context *ctx, const fz_key_storable *sc)
{
/* Explicitly drop const to allow us to use const
* sanely throughout the code. */
@@ -177,7 +177,7 @@ void fz_drop_key_storable(fz_context *ctx, const fz_key_storable *sc)
int unlock = 1;
if (s == NULL)
- return;
+ return 0;
if (s->storable.refs > 0)
(void)Memento_dropRef(s);
@@ -211,6 +211,7 @@ void fz_drop_key_storable(fz_context *ctx, const fz_key_storable *sc)
*/
if (drop)
s->storable.drop(ctx, &s->storable);
+ return drop;
}
void *fz_keep_key_storable_key(fz_context *ctx, const fz_key_storable *sc)