Skip to content

Commit a58cd83

Browse files
author
greatriver
committed
Fix a bug of drop document;
need keep page obj when load page.
1 parent 8cc7a25 commit a58cd83

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

source/pdf/pdf-interpret.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ pdf_process_keyword(hd_context *ctx, pdf_processor *proc, pdf_csi *csi, hd_strea
107107
font = load_font_or_hail_mary(ctx, csi->doc, fontobj);
108108
hd_try(ctx)
109109
proc->op_Tf(ctx, proc, csi->name, font, s[0]);
110+
hd_always(ctx)
111+
pdf_drop_font(ctx, font);
110112
hd_catch(ctx)
111113
hd_rethrow(ctx);
112114
}

source/pdf/pdf-page.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ pdf_load_page(hd_context *ctx, pdf_document *doc, int number)
221221
hd_rethrow(ctx);
222222

223223
page = pdf_new_page(ctx, doc);
224-
page->obj = pageobj;//pdf_keep_obj(ctx, pageobj);
224+
page->obj = pdf_keep_obj(ctx, pageobj);
225225
return page;
226226

227227
}

0 commit comments

Comments
 (0)