Button: fix memory leak
This commit is contained in:
parent
8eaf187984
commit
0c71fda5e1
1 changed files with 3 additions and 5 deletions
|
@ -52,11 +52,9 @@ void destroy_button(void *obj)
|
||||||
Button *button = (Button *)obj;
|
Button *button = (Button *)obj;
|
||||||
if (button->frontend) {
|
if (button->frontend) {
|
||||||
// This is a frontend element
|
// This is a frontend element
|
||||||
if (button->frontend->icon) {
|
free_icon(button->frontend->icon);
|
||||||
imlib_context_set_image(button->frontend->icon);
|
free_icon(button->frontend->icon_hover);
|
||||||
imlib_free_image();
|
free_icon(button->frontend->icon_pressed);
|
||||||
button->frontend->icon = NULL;
|
|
||||||
}
|
|
||||||
button->backend->instances = g_list_remove_all(button->backend->instances, button);
|
button->backend->instances = g_list_remove_all(button->backend->instances, button);
|
||||||
free_and_null(button->frontend);
|
free_and_null(button->frontend);
|
||||||
remove_area(&button->area);
|
remove_area(&button->area);
|
||||||
|
|
Loading…
Reference in a new issue