diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/html.c | 8 | ||||
-rw-r--r-- | render/html.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/render/html.c b/render/html.c index e028e523d..7e3fb834c 100644 --- a/render/html.c +++ b/render/html.c @@ -69,6 +69,7 @@ void html_create(struct content *c, const char *params[]) } html->parser = htmlCreatePushParserCtxt(0, 0, "", 0, 0, html->encoding); + html->document = 0; html->base_url = xstrdup(c->url); html->layout = 0; html->background_colour = TRANSPARENT; @@ -139,7 +140,7 @@ int html_convert(struct content *c, unsigned int width, unsigned int height) /* finish parsing */ htmlParseChunk(c->data.html.parser, "", 0, 1); - document = c->data.html.parser->myDoc; + document = c->data.html.document = c->data.html.parser->myDoc; /*xmlDebugDumpDocument(stderr, c->data.html.parser->myDoc);*/ htmlFreeParserCtxt(c->data.html.parser); c->data.html.parser = 0; @@ -181,7 +182,7 @@ int html_convert(struct content *c, unsigned int width, unsigned int height) /*box_dump(c->data.html.layout->children, 0);*/ /* XML tree not required past this point */ - xmlFreeDoc(document); + //xmlFreeDoc(document); /* layout the box tree */ sprintf(c->status_message, messages_get("Formatting")); @@ -755,6 +756,9 @@ void html_destroy(struct content *c) if (c->data.html.parser) htmlFreeParserCtxt(c->data.html.parser); + if (c->data.html.document) + xmlFreeDoc(c->data.html.document); + free(c->data.html.base_url); if (c->data.html.layout) diff --git a/render/html.h b/render/html.h index d029a7554..673e57317 100644 --- a/render/html.h +++ b/render/html.h @@ -36,6 +36,7 @@ struct box_position { /** Data specific to CONTENT_HTML. */ struct content_html_data { htmlParserCtxt *parser; /**< HTML parser context. */ + xmlDoc *document; /**< the XML document tree */ xmlCharEncoding encoding; /**< Encoding of source. */ bool getenc; /**< Need to get the encoding from the document, as server is broken. */ |