diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2015-01-21 13:20:36 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2015-01-27 14:05:20 -0800 |
commit | 7584edc737ebb5277801a9e6b51eb5531fdf84d2 (patch) | |
tree | 957a9d2e3d25ea63f0592fe09f1887f297445c9f /platform/windows/mupdfnet/mupdfnet.cpp | |
parent | b4e11b0b493c88e94a205643767e3c744ae17fde (diff) | |
download | mupdf-7584edc737ebb5277801a9e6b51eb5531fdf84d2.tar.xz |
Fix issue in display list Cache
The commit fc05b51c2b198dcc5553f6de1b8fb0e22e7d28ae cleaned up a few issues in the
display list cache but it introduced issues when multiple threads are using the lists.
In particular one thread could be using a list at the tail of the cache list, while
another thread is adding one to the cache, and removing the entry at the tail. The
solution is to make sure the ref count of the list is incremented when someone is using the list
and making sure that it gets decremented when they are done with the list.
Diffstat (limited to 'platform/windows/mupdfnet/mupdfnet.cpp')
-rw-r--r-- | platform/windows/mupdfnet/mupdfnet.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/windows/mupdfnet/mupdfnet.cpp b/platform/windows/mupdfnet/mupdfnet.cpp index 6a59aec9..854d40c5 100644 --- a/platform/windows/mupdfnet/mupdfnet.cpp +++ b/platform/windows/mupdfnet/mupdfnet.cpp @@ -287,6 +287,14 @@ SYMBOL_DECLSPEC void* __stdcall mCreateDisplayListText(void *ctx, int page_num, return text_ptr; } +SYMBOL_DECLSPEC void __stdcall mReleaseLists(void *ctx, void *dlist, + void *annot_dlist) +{ + muctx *mu_ctx = static_cast<muctx*>(ctx); + mu_ctx->ReleaseDisplayLists(dlist, annot_dlist); + return; +} + SYMBOL_DECLSPEC int __stdcall mRenderPageMT(void *ctx, void *dlist, void *annot_dlist, int page_width, int page_height, byte *bmp_data, int bmp_width, int bmp_height, double scale, bool flipy) |