From 2c700c95c42671ef124ca85bf616115ae9f99259 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 6 Feb 2012 13:25:57 +0100 Subject: Drop XPS links in the correct function. Prevents segfaults when revisiting pages and trying to access the link object that was freed too early. --- xps/xps_doc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xps/xps_doc.c b/xps/xps_doc.c index 340cd700..d8ab7bf4 100644 --- a/xps/xps_doc.c +++ b/xps/xps_doc.c @@ -225,6 +225,7 @@ xps_free_fixed_pages(xps_document *doc) { xps_page *next = page->next; xps_free_page(doc, page); + fz_drop_link(doc->ctx, page->links); fz_free(doc->ctx, page->name); fz_free(doc->ctx, page); page = next; @@ -463,6 +464,5 @@ xps_free_page(xps_document *doc, xps_page *page) /* only free the XML contents */ if (page->root) xml_free_element(doc->ctx, page->root); - fz_drop_link(doc->ctx, page->links); page->root = NULL; } -- cgit v1.2.3