From d14378ec1cc0f4a3e91850acf62621eca1ff6273 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 23 Nov 2016 14:01:41 +0100 Subject: [PATCH] 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 Reviewed-by: Jan Arne Petersen --- src/plugins/platforms/wayland/qwaylandinputcontext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp b/src/plugins/platforms/wayland/qwaylandinputcontext.cpp index 5a58d6d7509..dcc4ad5c7a0 100644 --- a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp +++ b/src/plugins/platforms/wayland/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(mCurrentWindow->handle())->object(); - textInput()->disable(surface); + if (surface) + textInput()->disable(surface); mCurrentWindow.clear(); } }