keymap = x11_compositor_get_keymap(c);
if (weston_seat_init_keyboard(&c->core_seat, keymap) < 0)
return -1;
- if (keymap)
- xkb_keymap_unref(keymap);
+ xkb_keymap_unref(keymap);
x11_compositor_setup_xkb(c);
#ifdef ENABLE_XKBCOMMON
if (keyboard->seat->compositor->use_xkbcommon) {
- if (keyboard->xkb_state.state != NULL)
- xkb_state_unref(keyboard->xkb_state.state);
+ xkb_state_unref(keyboard->xkb_state.state);
if (keyboard->xkb_info)
weston_xkb_info_destroy(keyboard->xkb_info);
- if (keyboard->pending_keymap)
- xkb_keymap_unref(keyboard->pending_keymap);
+ xkb_keymap_unref(keyboard->pending_keymap);
}
#endif
if (--xkb_info->ref_count > 0)
return;
- if (xkb_info->keymap)
- xkb_keymap_unref(xkb_info->keymap);
+ xkb_keymap_unref(xkb_info->keymap);
if (xkb_info->keymap_area)
munmap(xkb_info->keymap_area, xkb_info->keymap_size);
else
weston_seat_init_keyboard(&seat->base, keymap);
- if (keymap)
- xkb_keymap_unref(keymap);
+ xkb_keymap_unref(keymap);
return;