XCB: fix a memory leak

An early return didn't deallocate a xkb_state struct.

Change-Id: I158ffc67030403636aceab985cc605888a31804b
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
Giuseppe D'Angelo 2014-09-20 18:07:32 +02:00
parent b5ae9d8efe
commit 5c2d7b1635

View File

@ -852,8 +852,10 @@ QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
baseLayout, latchedLayout, lockedLayout);
xkb_keysym_t sym = xkb_state_key_get_one_sym(kb_state, event->nativeScanCode());
if (sym == XKB_KEY_NoSymbol)
if (sym == XKB_KEY_NoSymbol) {
xkb_state_unref(kb_state);
return QList<int>();
}
QList<int> result;
int baseQtKey = keysymToQtKey(sym, modifiers, lookupString(kb_state, event->nativeScanCode()));