backend-rdp: unref keymap after associating with seat
authorStefan Agner <stefan@agner.ch>
Thu, 20 Jun 2019 20:54:54 +0000 (22:54 +0200)
committerSimon Ser <contact@emersion.fr>
Mon, 13 Jan 2020 14:22:30 +0000 (14:22 +0000)
The function weston_seat_init_keyboard makes sure that it has its
own reference to keymap, hence we can safely drop our reference.
This is similarly done in the X11 backend. It avoids leaking a
struct xkb_keymap per connection.

Signed-off-by: Stefan Agner <stefan@agner.ch>
libweston/backend-rdp/rdp.c

index 6aec15d2f946fcb90f5c76845da2c8f35e7ed3ec..ce91cedd111baec06a5d074157bfc57019add7b4 100644 (file)
@@ -1064,6 +1064,7 @@ xf_peer_activate(freerdp_peer* client)
 
        weston_seat_init(peersItem->seat, b->compositor, seat_name);
        weston_seat_init_keyboard(peersItem->seat, keymap);
+       xkb_keymap_unref(keymap);
        weston_seat_init_pointer(peersItem->seat);
 
        peersItem->flags |= RDP_PEER_ACTIVATED;