libweston: fix output destroy signal list corruption
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 22 May 2018 10:15:58 +0000 (13:15 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 22 May 2018 10:15:58 +0000 (13:15 +0300)
This issue was likely introduced by "libweston: add
weston_view_set_output()" which forgot to ensure the output destroy
listener is removed when weston_view is destroyed, leading to freed
memory being left into the list.

This was quite easy to trigger by opening and closing an application
window a few times, leading various memory corruption symptoms.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
libweston/compositor.c

index 6a300e0dd0e1ed9a3b91f8a4f421bf5afcde9ad3..619e88b3a8aae3beb6f58169c1af12a4a5fffef1 100644 (file)
@@ -1931,6 +1931,7 @@ weston_view_destroy(struct weston_view *view)
        pixman_region32_fini(&view->transform.opaque);
 
        weston_view_set_transform_parent(view, NULL);
+       weston_view_set_output(view, NULL);
 
        wl_list_remove(&view->surface_link);