summaryrefslogtreecommitdiff
path: root/render/box.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-10-25 15:47:49 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-10-25 15:47:49 +0100
commit88ca82dea256be57b59a9ea536311b68a5580b12 (patch)
tree8ad58bf0d13cfaeffd391b26fb13087adc6639e9 /render/box.c
parent1cf0125f2dc49363f6fd94e8462bbdcbbd5e8669 (diff)
downloadnetsurf-88ca82dea256be57b59a9ea536311b68a5580b12.tar.gz
netsurf-88ca82dea256be57b59a9ea536311b68a5580b12.tar.bz2
Fix leak of box scrollbars.
Diffstat (limited to 'render/box.c')
-rw-r--r--render/box.c14
1 files changed, 14 insertions, 0 deletions
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;
}