summaryrefslogtreecommitdiff
path: root/apps/pdfapp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pdfapp.c')
-rw-r--r--apps/pdfapp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c
index 990dcd8c..4ec65148 100644
--- a/apps/pdfapp.c
+++ b/apps/pdfapp.c
@@ -189,12 +189,15 @@ void pdfapp_close(pdfapp_t *app)
pdf_freeoutline(app->outline);
app->outline = nil;
- if (app->xref->store)
- pdf_freestore(app->xref->store);
- app->xref->store = nil;
+ if (app->xref)
+ {
+ if (app->xref->store)
+ pdf_freestore(app->xref->store);
+ app->xref->store = nil;
- pdf_closexref(app->xref);
- app->xref = nil;
+ pdf_closexref(app->xref);
+ app->xref = nil;
+ }
}
static fz_matrix pdfapp_viewctm(pdfapp_t *app)