From 5d8959b30cad998e666af15af1aa9eb58827e644 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 22 Jul 2012 17:52:30 +0100 Subject: Fix reference handling when computing next node. --- render/box_construct.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'render') diff --git a/render/box_construct.c b/render/box_construct.c index b968e0e4f..fbaa9db5e 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -166,7 +166,7 @@ bool xml_to_box(dom_node *n, html_content *c, box_construct_complete_cb cb) return false; ctx->content = c; - ctx->n = n; + ctx->n = dom_node_ref(n); ctx->root_box = NULL; ctx->cb = cb; @@ -386,6 +386,7 @@ static dom_node *next_node(dom_node *n, html_content *content, dom_node_unref(n); return NULL; } + dom_node_unref(n); } else { err = dom_node_get_next_sibling(n, &next); if (err != DOM_NO_ERR) { @@ -423,6 +424,7 @@ static dom_node *next_node(dom_node *n, html_content *content, if (parent_next != NULL) { dom_node_unref(parent_next); + dom_node_unref(parent); break; } -- cgit v1.2.3