summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-clean.c6
-rw-r--r--source/pdf/pdf-run.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/source/pdf/pdf-clean.c b/source/pdf/pdf-clean.c
index ff54e6e7..680795a1 100644
--- a/source/pdf/pdf-clean.c
+++ b/source/pdf/pdf-clean.c
@@ -34,6 +34,8 @@ pdf_clean_stream_object(fz_context *ctx, pdf_document *doc, pdf_obj *obj, pdf_ob
proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, orig_res, res);
pdf_process_contents(ctx, proc_filter, doc, orig_res, obj, cookie);
+ pdf_close_processor(ctx, proc_filter);
+ pdf_close_processor(ctx, proc_buffer);
pdf_update_stream(ctx, doc, obj, buffer, 0);
@@ -94,6 +96,8 @@ pdf_clean_type3(fz_context *ctx, pdf_document *doc, pdf_obj *obj, pdf_obj *orig_
proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, orig_res, res);
pdf_process_contents(ctx, proc_filter, doc, orig_res, val, cookie);
+ pdf_close_processor(ctx, proc_filter);
+ pdf_close_processor(ctx, proc_buffer);
pdf_update_stream(ctx, doc, val, buffer, 0);
}
@@ -159,6 +163,8 @@ void pdf_clean_page_contents(fz_context *ctx, pdf_document *doc, pdf_page *page,
proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, resources, res);
pdf_process_contents(ctx, proc_filter, doc, resources, contents, cookie);
+ pdf_close_processor(ctx, proc_filter);
+ pdf_close_processor(ctx, proc_buffer);
/* Deal with page content stream. */
diff --git a/source/pdf/pdf-run.c b/source/pdf/pdf-run.c
index ba8b30b7..e00ad02b 100644
--- a/source/pdf/pdf-run.c
+++ b/source/pdf/pdf-run.c
@@ -12,7 +12,10 @@ pdf_run_annot_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf
proc = pdf_new_run_processor(ctx, dev, &local_ctm, usage, NULL, 0);
fz_try(ctx)
+ {
pdf_process_annot(ctx, proc, doc, page, annot, cookie);
+ pdf_close_processor(ctx, proc);
+ }
fz_always(ctx)
pdf_drop_processor(ctx, proc);
fz_catch(ctx)
@@ -39,7 +42,10 @@ pdf_run_page_contents_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *p
proc = pdf_new_run_processor(ctx, dev, &local_ctm, usage, NULL, 0);
fz_try(ctx)
+ {
pdf_process_contents(ctx, proc, doc, resources, contents, cookie);
+ pdf_close_processor(ctx, proc);
+ }
fz_always(ctx)
pdf_drop_processor(ctx, proc);
fz_catch(ctx)
@@ -170,7 +176,10 @@ pdf_run_glyph(fz_context *ctx, pdf_document *doc, pdf_obj *resources, fz_buffer
proc = pdf_new_run_processor(ctx, dev, ctm, "View", gstate, nested_depth+1);
fz_try(ctx)
+ {
pdf_process_glyph(ctx, proc, doc, resources, contents);
+ pdf_close_processor(ctx, proc);
+ }
fz_always(ctx)
pdf_drop_processor(ctx, proc);
fz_catch(ctx)