hmi-controller: add missing removals of surface listeners

The surface listeners must remove when hmi-controller destroying.
To avoid to use after free.

Suggested-by: Marius Vlad <marius.vlad@collabora.com>

Signed-off-by: Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>
This commit is contained in:
Tran Ba Khang(MS/EMC31-XC) 2022-11-10 16:18:29 +07:00 committed by Marius Vlad
parent dea53c33ea
commit 9fa161ed09
1 changed files with 4 additions and 0 deletions

View File

@ -758,6 +758,10 @@ hmi_controller_destroy(struct wl_listener *listener, void *data)
free(ctrl_layer_link);
}
wl_list_remove(&hmi_ctrl->surface_removed.link);
wl_list_remove(&hmi_ctrl->surface_configured.link);
wl_list_remove(&hmi_ctrl->desktop_surface_configured.link);
wl_array_release(&hmi_ctrl->ui_widgets);
free(hmi_ctrl->hmi_setting);
free(hmi_ctrl);