diff --git a/libweston/desktop/xdg-shell-v6.c b/libweston/desktop/xdg-shell-v6.c index e46cdd6c5..08aef859e 100644 --- a/libweston/desktop/xdg-shell-v6.c +++ b/libweston/desktop/xdg-shell-v6.c @@ -1200,6 +1200,14 @@ weston_desktop_xdg_surface_protocol_ack_configure(struct wl_client *wl_client, { struct weston_desktop_surface *dsurface = wl_resource_get_user_data(resource); + if (dsurface == NULL) { + wl_resource_post_error(resource, + ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED, + "xdg surface already destroyed configure " + "serial: %u", serial); + return; + } + struct weston_desktop_xdg_surface *surface = weston_desktop_surface_get_implementation_data(dsurface); struct weston_desktop_xdg_surface_configure *configure, *temp; diff --git a/libweston/desktop/xdg-shell.c b/libweston/desktop/xdg-shell.c index 0ec57c7fe..4be965c81 100644 --- a/libweston/desktop/xdg-shell.c +++ b/libweston/desktop/xdg-shell.c @@ -1414,6 +1414,14 @@ weston_desktop_xdg_surface_protocol_ack_configure(struct wl_client *wl_client, { struct weston_desktop_surface *dsurface = wl_resource_get_user_data(resource); + if (dsurface == NULL) { + wl_resource_post_error(resource, + XDG_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT, + "xdg surface already destroyed configure " + "serial: %u", serial); + return; + } + struct weston_desktop_xdg_surface *surface = weston_desktop_surface_get_implementation_data(dsurface); struct weston_desktop_xdg_surface_configure *configure, *temp;