summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmre Ucan <eucan@de.adit-jv.com>2016-08-25 11:18:51 +0200
committerEmre Ucan <eucan@de.adit-jv.com>2016-08-25 12:47:30 +0200
commitdc470faba1df9636f85903874e693da16c9380d7 (patch)
tree850b3cda6b966ec0a9fc3d3fff0aa17ebab1b444
parentcda593c28a0ccbd1c346fc3d8528d64f8b7b73b1 (diff)
downloadwayland-ivi-extension-dc470faba1df9636f85903874e693da16c9380d7.tar.gz
ilmControl: free accepted_seats when a surface is destroyed
The accepted_seat objects are dynamically allocated. Therefore, their memory has to be freed. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
-rw-r--r--ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
index dc2f4b7..0a4cf25 100644
--- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
@@ -632,6 +632,7 @@ controller_surface_listener_destroyed(void *data,
struct ivi_controller_surface *controller)
{
struct surface_context *ctx_surf = data;
+ struct accepted_seat *seat, *seat_next;
if (ctx_surf->notification != NULL) {
ctx_surf->notification(ctx_surf->id_surface,
@@ -647,6 +648,12 @@ controller_surface_listener_destroyed(void *data,
ivi_controller_surface_destroy(controller, 1);
+ wl_list_for_each_safe(seat, seat_next, &ctx_surf->list_accepted_seats, link) {
+ wl_list_remove(&seat->link);
+ free(seat->seat_name);
+ free(seat);
+ }
+
wl_list_remove(&ctx_surf->order.link);
wl_list_remove(&ctx_surf->link);
free(ctx_surf);
@@ -1050,7 +1057,14 @@ static void destroy_control_resources(void)
{
struct surface_context *l;
struct surface_context *n;
+ struct accepted_seat *seat, *seat_next;
wl_list_for_each_safe(l, n, &ctx->wl.list_surface, link) {
+ wl_list_for_each_safe(seat, seat_next, &l->list_accepted_seats, link) {
+ wl_list_remove(&seat->link);
+ free(seat->seat_name);
+ free(seat);
+ }
+
wl_list_remove(&l->link);
wl_list_remove(&l->order.link);
ivi_controller_surface_destroy(l->controller, 0);