Don't protect xkb_*_unref from NULL

Since xkbcommon-0.3.0, which is required by weston, a NULL argument
doesn't do anything.

Signed-off-by: Ran Benita <ran234@gmail.com>
dev
Ran Benita 10 years ago committed by Daniel Stone
parent 2e1968fa1f
commit c9c74156cd
  1. 1
      src/compositor-wayland.c
  2. 1
      src/compositor-x11.c
  3. 3
      src/input.c
  4. 1
      src/screen-share.c

@ -1464,7 +1464,6 @@ input_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format,
else else
weston_seat_init_keyboard(&input->base, keymap); weston_seat_init_keyboard(&input->base, keymap);
if (keymap)
xkb_keymap_unref(keymap); xkb_keymap_unref(keymap);
return; return;

@ -322,7 +322,6 @@ x11_input_create(struct x11_compositor *c, int no_input)
keymap = x11_compositor_get_keymap(c); keymap = x11_compositor_get_keymap(c);
if (weston_seat_init_keyboard(&c->core_seat, keymap) < 0) if (weston_seat_init_keyboard(&c->core_seat, keymap) < 0)
return -1; return -1;
if (keymap)
xkb_keymap_unref(keymap); xkb_keymap_unref(keymap);
x11_compositor_setup_xkb(c); x11_compositor_setup_xkb(c);

@ -544,11 +544,9 @@ weston_keyboard_destroy(struct weston_keyboard *keyboard)
#ifdef ENABLE_XKBCOMMON #ifdef ENABLE_XKBCOMMON
if (keyboard->seat->compositor->use_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) if (keyboard->xkb_info)
weston_xkb_info_destroy(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 #endif
@ -1869,7 +1867,6 @@ weston_xkb_info_destroy(struct weston_xkb_info *xkb_info)
if (--xkb_info->ref_count > 0) if (--xkb_info->ref_count > 0)
return; return;
if (xkb_info->keymap)
xkb_keymap_unref(xkb_info->keymap); xkb_keymap_unref(xkb_info->keymap);
if (xkb_info->keymap_area) if (xkb_info->keymap_area)

@ -214,7 +214,6 @@ ss_seat_handle_keymap(void *data, struct wl_keyboard *keyboard,
else else
weston_seat_init_keyboard(&seat->base, keymap); weston_seat_init_keyboard(&seat->base, keymap);
if (keymap)
xkb_keymap_unref(keymap); xkb_keymap_unref(keymap);
return; return;

Loading…
Cancel
Save