summaryrefslogtreecommitdiff
path: root/apps/pdfapp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pdfapp.c')
-rw-r--r--apps/pdfapp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c
index acad7c9f..556368ec 100644
--- a/apps/pdfapp.c
+++ b/apps/pdfapp.c
@@ -160,6 +160,10 @@ void pdfapp_close(pdfapp_t *app)
fz_free_text_page(app->ctx, app->page_text);
app->page_text = NULL;
+ if (app->page_sheet)
+ fz_free_text_sheet(app->ctx, app->page_sheet);
+ app->page_sheet = NULL;
+
if (app->page_links)
fz_drop_link(app->ctx, app->page_links);
app->page_links = NULL;
@@ -232,11 +236,19 @@ static void pdfapp_loadpage(pdfapp_t *app)
fz_free_display_list(app->ctx, app->page_list);
if (app->page_text)
fz_free_text_page(app->ctx, app->page_text);
+ if (app->page_sheet)
+ fz_free_text_sheet(app->ctx, app->page_sheet);
if (app->page_links)
fz_drop_link(app->ctx, app->page_links);
if (app->page)
fz_free_page(app->doc, app->page);
+ app->page_list = NULL;
+ app->page_text = NULL;
+ app->page_sheet = NULL;
+ app->page_links = NULL;
+ app->page = NULL;
+
fz_try(app->ctx)
{
app->page = fz_load_page(app->doc, app->pageno - 1);