diff --git a/src/autotype/x11/AutoTypeX11.cpp b/src/autotype/x11/AutoTypeX11.cpp index 6a2b2ab6d..7f26aa08f 100644 --- a/src/autotype/x11/AutoTypeX11.cpp +++ b/src/autotype/x11/AutoTypeX11.cpp @@ -69,8 +69,14 @@ bool AutoTypePlatformX11::isAvailable() return false; } - if (!m_xkb && !getKeyboard()) { - return false; + if (!m_xkb) { + XkbDescPtr kbd = getKeyboard(); + + if (!kbd) { + return false; + } + + XkbFreeKeyboard(kbd, XkbAllComponentsMask, True); } return true;