mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 10:18:01 +02:00
clients: Fix crash when removing and reinserting outputs
If we don't receive a surface_leave before an output_destroy, the window output lists can hold a stale reference to the destroyed output. Call surface_leave for the output on all windows to make sure it's not on any lists. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
a879fff2ec
commit
be1e58beec
1 changed files with 13 additions and 0 deletions
|
|
@ -5946,6 +5946,19 @@ display_destroy_output(struct display *d, uint32_t id)
|
|||
|
||||
wl_list_for_each(output, &d->output_list, link) {
|
||||
if (output->server_output_id == id) {
|
||||
struct window *window;
|
||||
|
||||
/* If a window was on a destroyed output, we need to
|
||||
* make sure the output doesn't linger on the window's
|
||||
* output list.
|
||||
* surface_leave does nothing if the output isn't on
|
||||
* the list, so we can call it for all windows to remove
|
||||
* this output.
|
||||
*/
|
||||
wl_list_for_each(window, &d->window_list, link) {
|
||||
surface_leave(window, NULL, output->output);
|
||||
}
|
||||
|
||||
output_destroy(output);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue