1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-27 02:56:18 -04:00

DOM: Cleanup the parser stack properly in done_sgml_parser

This commit is contained in:
Jonas Fonseca 2007-09-18 02:04:40 +02:00
parent e12a927857
commit 2e831c2e37
2 changed files with 6 additions and 7 deletions

View File

@ -719,9 +719,15 @@ init_sgml_parser(enum sgml_parser_type type, enum sgml_document_type doctype,
void
done_sgml_parser(struct sgml_parser *parser)
{
while (!dom_stack_is_empty(&parser->stack)) {
get_dom_stack_top(&parser->stack)->immutable = 0;
pop_dom_node(&parser->stack);
}
while (!dom_stack_is_empty(&parser->parsing))
pop_dom_node(&parser->parsing);
done_dom_stack(&parser->parsing);
done_dom_stack(&parser->stack);
done_dom_string(&parser->uri);
mem_free(parser);

View File

@ -425,13 +425,6 @@ main(int argc, char *argv[])
}
if (parser->root) {
assert(!complete || parser->stack.depth > 0);
while (!dom_stack_is_empty(&parser->stack)) {
get_dom_stack_top(&parser->stack)->immutable = 0;
pop_dom_node(&parser->stack);
}
if (normalize || dump) {
struct dom_stack stack;