ilmControl: destroy output objects, even w/o controller
authorMarcus Fritzsch <marcus.fritzsch@xse.de>
Wed, 20 Aug 2014 14:40:28 +0000 (16:40 +0200)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Mon, 1 Sep 2014 06:55:43 +0000 (15:55 +0900)
Signed-off-by: Marcus Fritzsch <marcus.fritzsch@xse.de>
ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c

index a1968f5..3aae4c5 100644 (file)
@@ -951,6 +951,21 @@ static void destroy_control_resources(void)
 {
     struct ilm_control_context *ctx = &ilm_context;
 
+    // free resources of output objects
+    if (! ctx->wl.controller) {
+        struct screen_context *ctx_scrn;
+        struct screen_context *next;
+
+        wl_list_for_each_safe(ctx_scrn, next, &ctx->wl.list_screen, link) {
+            if (ctx_scrn->output != NULL) {
+                wl_output_destroy(ctx_scrn->output);
+            }
+
+            wl_list_remove(&ctx_scrn->link);
+            free(ctx_scrn);
+        }
+    }
+
     if (ctx->wl.controller != NULL) {
         {
             struct surface_context *l;