From e558d59ca8c189c947a3976450bdb3073978de9a Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 22 Mar 2013 19:17:24 +0000 Subject: Ensure that store bookkeeping doesn't go wrong on reinsertion. If we find that the store already contains a copy of an object, then we don't reinsert it. We should therefore undo the addition of the object size that we just did. --- fitz/res_store.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fitz') diff --git a/fitz/res_store.c b/fitz/res_store.c index f9f305d9..fd42d2e8 100644 --- a/fitz/res_store.c +++ b/fitz/res_store.c @@ -267,6 +267,7 @@ fz_store_item(fz_context *ctx, void *key, void *val_, unsigned int itemsize, fz_ if (existing) { /* Take a new reference */ + store->size -= itemsize; if (existing->val->refs > 0) existing->val->refs++; fz_unlock(ctx, FZ_LOCK_ALLOC); -- cgit v1.2.3