From 88ca82dea256be57b59a9ea536311b68a5580b12 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 25 Oct 2013 15:47:49 +0100 Subject: Fix leak of box scrollbars. --- render/box.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'render') diff --git a/render/box.c b/render/box.c index 1f2c9fe0e..e955b4303 100644 --- a/render/box.c +++ b/render/box.c @@ -79,6 +79,8 @@ void *box_style_alloc(void *ptr, size_t len, void *pw) */ static int box_talloc_destructor(struct box *b) { + struct html_scrollbar_data *data; + if ((b->flags & STYLE_OWNED) && b->style != NULL) { css_computed_style_destroy(b->style); b->style = NULL; @@ -100,6 +102,18 @@ static int box_talloc_destructor(struct box *b) dom_node_unref(b->node); } + if (b->scroll_x != NULL) { + data = scrollbar_get_data(b->scroll_x); + scrollbar_destroy(b->scroll_x); + free(data); + } + + if (b->scroll_y != NULL) { + data = scrollbar_get_data(b->scroll_y); + scrollbar_destroy(b->scroll_y); + free(data); + } + return 0; } -- cgit v1.2.3