summaryrefslogtreecommitdiff
path: root/render/html.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-02-17 12:41:38 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-02-17 12:41:38 +0000
commit6839622183b74914ed0bcb83387fedf6459e2c5c (patch)
tree64c43df07040afa8d8eea32138db241435f8c2af /render/html.c
parent8cece1f41f50afb11a707badc118b0b62158fa85 (diff)
downloadnetsurf-6839622183b74914ed0bcb83387fedf6459e2c5c.tar.gz
netsurf-6839622183b74914ed0bcb83387fedf6459e2c5c.tar.bz2
[project @ 2004-02-17 12:41:38 by jmb]
Begin save complete support. Fix memory leak when using Select PNG renderer. (commented out lines can probably removed) svn path=/import/netsurf/; revision=556
Diffstat (limited to 'render/html.c')
-rw-r--r--render/html.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/render/html.c b/render/html.c
index 476c8b6f2..a66346806 100644
--- a/render/html.c
+++ b/render/html.c
@@ -128,19 +128,9 @@ int html_convert(struct content *c, unsigned int width, unsigned int height)
xml_to_box(html, c);
/*box_dump(c->data.html.layout->children, 0);*/
- /* XML tree and stylesheets not required past this point */
+ /* XML tree not required past this point */
xmlFreeDoc(document);
- content_remove_user(c->data.html.stylesheet_content[0],
- html_convert_css_callback, c, 0);
- if (c->data.html.stylesheet_content[1] != 0)
- content_destroy(c->data.html.stylesheet_content[1]);
- for (i = 2; i != c->data.html.stylesheet_count; i++)
- if (c->data.html.stylesheet_content[i] != 0)
- content_remove_user(c->data.html.stylesheet_content[i],
- html_convert_css_callback, c, (void*)i);
- xfree(c->data.html.stylesheet_content);
-
/* layout the box tree */
sprintf(c->status_message, "Formatting document");
content_broadcast(c, CONTENT_MSG_STATUS, 0);
@@ -660,6 +650,18 @@ void html_destroy(struct content *c)
unsigned int i;
LOG(("content %p", c));
+ /* Remove stylesheets */
+ content_remove_user(c->data.html.stylesheet_content[0],
+ html_convert_css_callback, c, 0);
+ if (c->data.html.stylesheet_content[1] != 0)
+ content_destroy(c->data.html.stylesheet_content[1]);
+ for (i = 2; i != c->data.html.stylesheet_count; i++)
+ if (c->data.html.stylesheet_content[i] != 0)
+ content_remove_user(c->data.html.stylesheet_content[i],
+ html_convert_css_callback, c, (void*)i);
+ xfree(c->data.html.stylesheet_content);
+
+ /* and objects */
for (i = 0; i != c->data.html.object_count; i++) {
LOG(("object %i %p", i, c->data.html.object[i].content));
if (c->data.html.object[i].content != 0)