Skip to content

Commit

Permalink
Wayland: Avoid NULL dereference after window destruction (thanks, "x4…
Browse files Browse the repository at this point in the history
…14e54"!).

Fixes Bugzilla #2934.
  • Loading branch information
icculus committed May 27, 2015
1 parent 7f17e0a commit 9c34368
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/video/wayland/SDL_waylandevents.c
Expand Up @@ -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;
Expand Down

0 comments on commit 9c34368

Please sign in to comment.