window: Don't deref focus widget if there isn't one

This commit is contained in:
Kristian Høgsberg 2012-01-11 11:18:14 -05:00
parent f0993f61c0
commit 62444800e1

View File

@ -978,7 +978,8 @@ window_destroy(struct window *window)
wl_list_for_each(input, &display->input_list, link) {
if (input->pointer_focus == window)
input->pointer_focus = NULL;
if (input->focus_widget->window == window)
if (input->focus_widget &&
input->focus_widget->window == window)
input->focus_widget = NULL;
if (input->keyboard_focus == window)
input->keyboard_focus = NULL;