summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2014-06-13 18:10:26 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-06-25 16:27:45 +0300
commiteff280ec1c63f7c19d1e5c6e3ea4110603956b34 (patch)
treeda947f8f36587d9e1f3222e543de5eeab1415eaa
parenta35d028d66cdd83a4a08663231dd2504f1b228f9 (diff)
compositor: unmap subsurface views before destroying the subsurfaces
This is to avoid recursing into weston_compositor_build_view_list() and therefore fix crashing when destroying a stack of visible subsurfaces due to weston_compositor_build_view_list() being called recursively and corrupting the lists it works on. https://bugs.freedesktop.org/show_bug.cgi?id=79684
-rw-r--r--src/compositor.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 574db2de..747acd6b 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1662,8 +1662,10 @@ surface_free_unused_subsurface_views(struct weston_surface *surface)
if (sub->surface == surface)
continue;
- wl_list_for_each_safe(view, nv, &sub->unused_views, surface_link)
+ wl_list_for_each_safe(view, nv, &sub->unused_views, surface_link) {
+ weston_view_unmap (view);
weston_view_destroy(view);
+ }
surface_free_unused_subsurface_views(sub->surface);
}
@@ -2746,8 +2748,10 @@ weston_subsurface_destroy(struct weston_subsurface *sub)
assert(sub->parent_destroy_listener.notify ==
subsurface_handle_parent_destroy);
- wl_list_for_each_safe(view, next, &sub->surface->views, surface_link)
+ wl_list_for_each_safe(view, next, &sub->surface->views, surface_link) {
+ weston_view_unmap(view);
weston_view_destroy(view);
+ }
if (sub->parent)
weston_subsurface_unlink_parent(sub);