summaryrefslogtreecommitdiff
path: root/src/treebuilder/before_html.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-07-15 10:52:13 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-07-15 10:52:13 +0000
commit2f716a2a02f5c3728b8721736400fedefda46bc2 (patch)
tree6d0432bf4fdb17625957fe9ba2cb68ace8527aef /src/treebuilder/before_html.c
parentdf73d242d905943a2282d7097e0ec9de9448847b (diff)
downloadlibhubbub-2f716a2a02f5c3728b8721736400fedefda46bc2.tar.gz
libhubbub-2f716a2a02f5c3728b8721736400fedefda46bc2.tar.bz2
Make tree2 perform reference counting.
Fix bits of the treebuilder to perform reference counting correctly in the face of *result not pointing to the same object as the node passed in to the treebuilder client callbacks. svn path=/trunk/hubbub/; revision=4666
Diffstat (limited to 'src/treebuilder/before_html.c')
-rw-r--r--src/treebuilder/before_html.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/treebuilder/before_html.c b/src/treebuilder/before_html.c
index ebfc92f..8401087 100644
--- a/src/treebuilder/before_html.c
+++ b/src/treebuilder/before_html.c
@@ -104,21 +104,21 @@ bool handle_before_html(hubbub_treebuilder *treebuilder,
html);
}
+ treebuilder->tree_handler->unref_node(
+ treebuilder->tree_handler->ctx,
+ html);
+
/* We can't use element_stack_push() here, as it
* assumes that current_node is pointing at the index
* before the one to insert at. For the first entry in
* the stack, this does not hold so we must insert
* manually. */
treebuilder->context.element_stack[0].type = HTML;
- treebuilder->context.element_stack[0].node = html;
+ treebuilder->context.element_stack[0].node = appended;
treebuilder->context.current_node = 0;
/** \todo cache selection algorithm */
- treebuilder->tree_handler->unref_node(
- treebuilder->tree_handler->ctx,
- appended);
-
treebuilder->context.mode = BEFORE_HEAD;
}