ivi-cotroller: Avoid double free of surface.
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Tue, 3 Jun 2014 11:19:29 +0000 (04:19 -0700)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Tue, 17 Jun 2014 01:15:05 +0000 (10:15 +0900)
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
weston-ivi-shell/src/ivi-controller.c

index f9692ba..8cfd9ed 100755 (executable)
@@ -153,6 +153,7 @@ struct ivishell {
     int previous_state;
     int event_restriction;
 };
+static void surface_event_remove(struct ivi_layout_surface *, void *);
 
 static void
 destroy_ivicontroller_surface(struct wl_resource *resource)
@@ -1127,14 +1128,7 @@ surface_event_content(struct ivi_layout_surface *layout_surface, int32_t content
     uint32_t id_surface = 0;
 
     if (content == 0) {
-        id_surface = ivi_layout_getIdOfSurface(layout_surface);
-
-        wl_list_for_each(ctrlsurf, &shell->list_controller_surface, link) {
-            if (id_surface != ctrlsurf->id_surface) {
-                continue;
-            }
-            ivi_controller_surface_send_destroyed(ctrlsurf->resource);
-        }
+        surface_event_remove(layout_surface, userdata);
     }
 }