summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/mudraw.c3
-rw-r--r--apps/pdfapp.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/apps/mudraw.c b/apps/mudraw.c
index 29517873..a0abc022 100644
--- a/apps/mudraw.c
+++ b/apps/mudraw.c
@@ -530,6 +530,9 @@ int main(int argc, char **argv)
printf("</style>\n");
}
+ if (showtext)
+ fz_free_text_sheet(ctx, sheet);
+
if (showtime)
{
printf("total %dms / %d pages for an average of %dms\n",
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);