desktop-shell: fix output destroy signal list corruption

This issue was introduced by "desktop-shell: detect stale shell surface
outputs" which forgot to remove the output destroy listener when
shell_surface is destroyed, leading to memory corruption.

This was fairly easy to trigger by opening and closing an application
window a few times.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
This commit is contained in:
Pekka Paalanen 2018-05-22 12:48:35 +03:00
parent 99f8c08559
commit 99628000cb
1 changed files with 12 additions and 0 deletions

View File

@ -2303,6 +2303,12 @@ fade_out_done_idle_cb(void *data)
struct shell_surface *shsurf = data;
weston_surface_destroy(shsurf->view->surface);
if (shsurf->output_destroy_listener.notify) {
wl_list_remove(&shsurf->output_destroy_listener.link);
shsurf->output_destroy_listener.notify = NULL;
}
free(shsurf);
}
@ -2420,6 +2426,12 @@ desktop_surface_removed(struct weston_desktop_surface *desktop_surface,
fade_out_done, shsurf);
} else {
weston_view_destroy(shsurf->view);
if (shsurf->output_destroy_listener.notify) {
wl_list_remove(&shsurf->output_destroy_listener.link);
shsurf->output_destroy_listener.notify = NULL;
}
free(shsurf);
}
}