diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-02-17 10:30:59 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-02-17 18:06:11 +0100 |
commit | 72679561cddc6b2586e596f62492b79dcf9f118d (patch) | |
tree | 25d156aacc2d2ac3e33170ec42b6501edb9b6754 /source/fitz/hash.c | |
parent | 6cc97e85489f5e4e39aa185d17ad5e35b09dddb5 (diff) | |
download | mupdf-72679561cddc6b2586e596f62492b79dcf9f118d.tar.xz |
Add helper functions to keep/drop reference counts with locking.
Add locks around fz_path and fz_text reference counting.
Diffstat (limited to 'source/fitz/hash.c')
-rw-r--r-- | source/fitz/hash.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/fitz/hash.c b/source/fitz/hash.c index acd22334..f80e79b3 100644 --- a/source/fitz/hash.c +++ b/source/fitz/hash.c @@ -159,10 +159,10 @@ fz_resize_hash(fz_context *ctx, fz_hash_table *table, int newsize) } if (table->lock == FZ_LOCK_ALLOC) - fz_unlock(ctx, FZ_LOCK_ALLOC); + fz_unlock(ctx, table->lock); newents = fz_malloc_array_no_throw(ctx, newsize, sizeof(fz_hash_entry)); if (table->lock == FZ_LOCK_ALLOC) - fz_lock(ctx, FZ_LOCK_ALLOC); + fz_lock(ctx, table->lock); if (table->lock >= 0) { if (table->size >= newsize) @@ -192,10 +192,10 @@ fz_resize_hash(fz_context *ctx, fz_hash_table *table, int newsize) } if (table->lock == FZ_LOCK_ALLOC) - fz_unlock(ctx, FZ_LOCK_ALLOC); + fz_unlock(ctx, table->lock); fz_free(ctx, oldents); if (table->lock == FZ_LOCK_ALLOC) - fz_lock(ctx, FZ_LOCK_ALLOC); + fz_lock(ctx, table->lock); } void * |