mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-01-04 19:10:20 +01:00
compositor: prevent weston_surface references a destroyed output
weston_surface retains a pointer to its associated output, but if the output is destroyed, the pointer becomes invalid. In set_fullscreen(), weston_shell_utils_get_focused_output may return this stale output via weston_keyboard, leading to a use-after-free crash. This change ensures the output reference is cleared when the output is destroyed, preventing potential crashes. Signed-off-by: zhou liang <liang.zhou@gehealthcare.com>
This commit is contained in:
parent
0286b37d76
commit
fc3e3cf653
1 changed files with 1 additions and 0 deletions
|
|
@ -1483,6 +1483,7 @@ notify_view_output_destroy(struct wl_listener *listener, void *data)
|
|||
struct weston_view, output_destroy_listener);
|
||||
|
||||
view->output = NULL;
|
||||
view->surface->output = NULL;
|
||||
view->output_destroy_listener.notify = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue