diff options
author | John-Mark Bell <jmb@netsurf-browser.org> | 2012-07-22 17:52:30 +0100 |
---|---|---|
committer | John-Mark Bell <jmb@netsurf-browser.org> | 2012-07-22 17:52:30 +0100 |
commit | 5d8959b30cad998e666af15af1aa9eb58827e644 (patch) | |
tree | a12dd55cbac058ea28a699e792bc22b84ad6a582 | |
parent | 2ad24f39da6a314a1e3839c355103a6af131bc09 (diff) | |
download | netsurf-5d8959b30cad998e666af15af1aa9eb58827e644.tar.gz netsurf-5d8959b30cad998e666af15af1aa9eb58827e644.tar.bz2 |
Fix reference handling when computing next node.
-rw-r--r-- | render/box_construct.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |