diff options
-rw-r--r-- | render/box.c | 14 |
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; } |