mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-07-21 02:25:36 +00:00
shell: Fix segfault from trying to access a destroyed popup shell surface
The shell_destroy_shell_surface function only set the backing resource to NULL, leaving an unusable surface in the popup_grab list until the surface's fading animation finished and it could be freed. This caused a segfault if the shell tried to forcibly break the grab during that time interval due to the compositor losing the keyboard focus. https://bugs.freedesktop.org/show_bug.cgi?id=77072
This commit is contained in:
parent
fdc3e4c3f4
commit
a46b946cb3
|
@ -3050,6 +3050,8 @@ shell_destroy_shell_surface(struct wl_resource *resource)
|
|||
{
|
||||
struct shell_surface *shsurf = wl_resource_get_user_data(resource);
|
||||
|
||||
if (!wl_list_empty(&shsurf->popup.grab_link))
|
||||
remove_popup_grab(shsurf);
|
||||
shsurf->resource = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue