iOS: Don't try to initialize a11y for views that have no platform window

The window may have been destroyed, but the UIView may still be
be referenced and kept alive by the a11y subsystem.

Pick-to: 6.2 5.15
Task-number: QTBUG-94530
Change-Id: I24f1c9d45e80c1bb4c92536e7f91533a94fd077f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Tor Arne Vestbø 2021-11-03 16:35:57 +01:00
parent 9568362bfe
commit f2d1502429
1 changed files with 5 additions and 0 deletions

View File

@ -66,6 +66,11 @@
- (void)initAccessibility
{
// The window may have gone away, but with the view
// temporarily caught in the a11y subsystem.
if (!self.platformWindow)
return;
static bool init = false;
if (!init)
QGuiApplicationPrivate::platformIntegration()->accessibility()->setActive(true);