summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-03-15 15:42:30 +0000
committerRobin Watts <robin.watts@artifex.com>2016-03-15 16:50:28 +0000
commit9909bfe5452b10c677a6cbb410db036fb9788811 (patch)
tree686315a3be02ccdd6ed3c1dd4d67e0672fc67fe5
parent15b93459af39a4ac68c055e6184be5db8c2c3aba (diff)
downloadmupdf-9909bfe5452b10c677a6cbb410db036fb9788811.tar.xz
Make all ref changes on storable items Memento trackable.
-rw-r--r--source/fitz/store.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/fitz/store.c b/source/fitz/store.c
index c2c86b00..b995f915 100644
--- a/source/fitz/store.c
+++ b/source/fitz/store.c
@@ -60,6 +60,8 @@ fz_keep_storable(fz_context *ctx, const fz_storable *sc)
* sanely throughout the code. */
fz_storable *s = (fz_storable *)sc;
+ if (s && s->refs > 0)
+ Memento_takeRef(s);
return fz_keep_imp(ctx, s, &s->refs);
}
@@ -77,6 +79,8 @@ fz_drop_storable(fz_context *ctx, const fz_storable *sc)
this method. So we can simply drop the storable object
itself without any operations on the fz_store.
*/
+ if (s && s->refs > 0)
+ Memento_dropRef(s);
if (fz_drop_imp(ctx, s, &s->refs))
s->drop(ctx, s);
}