Linux: fix crash in AtSpi adaptor when handling window activation

fix The window has been quickly activated or disabled will cause a crash .

Fixes: QTBUG-84643
Pick-to: 5.15
Change-Id: I0fd0918a3fc1898ddffd97009a4e92702ecd9ed4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Lu YaNing 2020-07-07 09:18:16 +08:00
parent ae81055fe2
commit 1ac7bf1ed4

View File

@ -804,7 +804,9 @@ void AtSpiAdaptor::windowActivated(QObject* window, bool active)
return;
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(window);
Q_ASSERT(iface);
// If the window has been quickly activated or disabled, it will cause a crash.
if (iface == nullptr)
return;
Q_ASSERT(!active || iface->isValid());
QString windowTitle;