Wayland: Avoid NULL dereference after window destruction (thanks, "x414e54"!).

Fixes Bugzilla #2934.
This commit is contained in:
Ryan C. Gordon 2015-05-27 18:54:06 -04:00
parent 7f17e0ab9e
commit 9c343681c4
1 changed files with 6 additions and 0 deletions

View File

@ -293,6 +293,12 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard,
struct wl_array *keys)
{
struct SDL_WaylandInput *input = data;
if (!surface) {
/* enter event for a window we've just destroyed */
return;
}
SDL_WindowData *window = wl_surface_get_user_data(surface);
input->keyboard_focus = window;