summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2016-11-23 14:01:41 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2016-11-23 13:51:54 +0000
commit20869ff8a1ae94475036a093c0ab421af95d840a (patch)
treee1c4c75abd468ebff6b02cef3689dc1c898b31cc
parent36dcbb054ec84f6d93d755d905ad3d9bcadb2900 (diff)
Fix crash when destroying focus window
Make sure we don't try to disable input for a window that has already been destroyed. Change-Id: I1224599b3c43e2315b3571f01c5896a001614dc4 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
-rw-r--r--src/client/qwaylandinputcontext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp
index 5a58d6d7..dcc4ad5c 100644
--- a/src/client/qwaylandinputcontext.cpp
+++ b/src/client/qwaylandinputcontext.cpp
@@ -532,7 +532,8 @@ void QWaylandInputContext::setFocusObject(QObject *)
if (mCurrentWindow && mCurrentWindow->handle()) {
if (mCurrentWindow.data() != window || !inputMethodAccepted()) {
struct ::wl_surface *surface = static_cast<QWaylandWindow *>(mCurrentWindow->handle())->object();
- textInput()->disable(surface);
+ if (surface)
+ textInput()->disable(surface);
mCurrentWindow.clear();
}
}