summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-07-08 12:04:35 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-07-08 17:21:24 +0200
commit10d6eaa73164b58c91ae8a4537b8a8589038a01d (patch)
tree5b739b0c2202b42a9079ee3ecbd98c3d3b09b124 /docs
parentb53e7a42f7cc9756ed9fa1fed313271e3ae67855 (diff)
downloadmupdf-10d6eaa73164b58c91ae8a4537b8a8589038a01d.tar.xz
Separate close and drop functionality for devices and writers.
Closing a device or writer may throw exceptions, but much of the foreign language bindings (JNI and JS) depend on drop to never throw an exception (exceptions in finalizers are bad).
Diffstat (limited to 'docs')
-rw-r--r--docs/multi-threaded.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/multi-threaded.c b/docs/multi-threaded.c
index 6f07b543..15fdcba2 100644
--- a/docs/multi-threaded.c
+++ b/docs/multi-threaded.c
@@ -96,6 +96,7 @@ renderer(void *data)
fprintf(stderr, "thread at page %d rendering!\n", pagenumber);
dev = fz_new_draw_device(ctx, &fz_identity, pix);
fz_run_display_list(ctx, list, dev, &fz_identity, &bbox, NULL);
+ fz_close_device(ctx, dev);
fz_drop_device(ctx, dev);
// This threads context is freed.
@@ -212,6 +213,7 @@ int main(int argc, char **argv)
dev = fz_new_list_device(ctx, list);
fz_run_page(ctx, page, dev, &fz_identity, NULL);
+ fz_close_device(ctx, dev);
fz_drop_device(ctx, dev);
// The page is no longer needed, all drawing commands