From 5dcfd1a719b12c71237129cafb7612dc830edea0 Mon Sep 17 00:00:00 2001 From: Nobuhiko Tanibata Date: Mon, 26 May 2014 10:52:57 +0900 Subject: Fix seg-fault during a test-application running. --- ivi-shell/ivi-layout.c | 8 ++++++-- ivi-shell/ivi-shell.c | 3 --- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index ae947c65..af84eb63 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -349,6 +349,9 @@ remove_orderlayer_from_screen(struct ivi_layout_layer *ivilayer) if (!wl_list_empty(&link_scrn->link)) { wl_list_remove(&link_scrn->link); } + if (!wl_list_empty(&link_scrn->link_to_screen)) { + wl_list_remove(&link_scrn->link_to_screen); + } free(link_scrn); } wl_list_init(&ivilayer->list_screen); @@ -838,6 +841,7 @@ commit_list_layer(struct ivi_layout *layout) wl_list_insert(&ivilayer->order.list_surface, &ivisurf->order.link); add_ordersurface_to_layer(ivisurf, ivilayer); + ivisurf->event_mask = IVI_NOTIFICATION_ADD; } } } @@ -869,6 +873,7 @@ commit_list_screen(struct ivi_layout *layout) wl_list_insert(&iviscrn->order.list_layer, &ivilayer->order.link); add_orderlayer_to_screen(ivilayer, iviscrn); + ivilayer->event_mask = IVI_NOTIFICATION_ADD; } iviscrn->event_mask = 0; } @@ -1956,7 +1961,7 @@ ivi_layout_layerSetRenderOrder(struct ivi_layout_layer *ivilayer, for (i = 0; i < number; i++) { id_surface = &pSurface[i]->id_surface; - wl_list_for_each(ivisurf, &layout->list_surface, link) { + wl_list_for_each_safe(ivisurf, next, &layout->list_surface, pending.link) { if (*id_surface != ivisurf->id_surface) { continue; } @@ -2630,7 +2635,6 @@ ivi_layout_surfaceSetNativeContent(struct weston_surface *surface, } wl_list_remove(&ivisurf->surface_destroy_listener.link); - weston_view_destroy(ivisurf->view); ivisurf->surface = NULL; ivisurf->view = NULL; diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index fac0c4e9..52463c08 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -132,15 +132,12 @@ static void surface_destroy(struct wl_client *client, struct wl_resource *resource) { struct ivi_shell_surface *ivisurf = wl_resource_get_user_data(resource); - if (ivisurf != NULL) { ivisurf->surface->configure = NULL; ivisurf->surface->configure_private = NULL; ivisurf->surface = NULL; ivi_layout->surfaceSetNativeContent(NULL, 0, 0, ivisurf->id_surface); } - - wl_resource_destroy(resource); } static const struct ivi_surface_interface surface_implementation = { -- cgit v1.2.1