summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-05-01 17:41:17 +0300
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-05-04 09:22:39 +0000
commit144777d0be9875135761ee596430c0e1359df833 (patch)
tree8117850b911b7a8494003ec5670f31b62b31c7bf
parent6dc52bb81763dd88d020032212834c8d3a5b8027 (diff)
downloadqtwayland-144777d0be9875135761ee596430c0e1359df833.tar.gz
Fix crash on keyboard remove
If the compositor sent a wl_keyboard.leave and a new wl_seat.capabilities without the keyboard bit we would end up deleting the Keyboard object with a roundtrip in flight, ending up using freed memory later. Destroy the callback when destroying the keyboard, and notify the window system the active window is active no more. Change-Id: Ie415ca62b46e0b8ef0fe4d09c8e7a8130928df90 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r--src/client/qwaylandinputdevice.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 8c896528..b2268ae7 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -118,6 +118,10 @@ QWaylandInputDevice::Keyboard::~Keyboard()
#ifndef QT_NO_WAYLAND_XKB
releaseKeyMap();
#endif
+ if (mFocus)
+ QWindowSystemInterface::handleWindowActivated(0);
+ if (mFocusCallback)
+ wl_callback_destroy(mFocusCallback);
if (mParent->mVersion >= 3)
wl_keyboard_release(object());
else