mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-26 16:29:36 +03:00
Fix leak of box scrollbars.
This commit is contained in:
parent
1cf0125f2d
commit
88ca82dea2
14
render/box.c
14
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user