Dangling pointers and memory corruption after output recreate.
Submitted by Andriy Prystupa
Assigned to Wayland bug list
Description
Way to reproduce:
- weston backend closes current output and creates new one.
- old weston_output structure is released.
- compositor views have pointers to old weston_output.
- these pointers became dangling.
Fix: in weston_compositor_remove_output(...) add resetting reference to output: wl_list_for_each(view, &compositor->view_list, link) { if (view->output == remove_output) { view->output = NULL; view->surface->output = NULL; } }