summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2016-01-25 11:26:09 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-28 18:09:14 +0000
commit14ef6abd0b8bb877edc0c479cd8a0067a4346c70 (patch)
tree6298da4c942a4ab44fafc6711c13a9e108fbb990 /src/plugins/platforms/cocoa/qcocoaaccessibility.mm
parenta67a905190b85b53c30c9cb800b5e282d9364179 (diff)
Accessibility OS X: protect from accessing invalid objects
Usually when getting an object from an interface, the object can be assumed to be valid. We need to check isValid though since the screen reader access is inherently asynchronous and objects might be in the QWidget destructor where the QObject is still valid. Thus check QAccessibleInterface::isValid in all uses of it in the OS X implementation. Task-number: QTBUG-50545 Change-Id: I6e142f6ead1b3281cab2cbc61ce1406bbfe29f69 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaaccessibility.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index 723c341e59..624220ae5e 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -51,7 +51,7 @@ QCocoaAccessibility::~QCocoaAccessibility()
void QCocoaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
{
- if (!isActive() || !event->accessibleInterface())
+ if (!isActive() || !event->accessibleInterface() || !event->accessibleInterface()->isValid())
return;
QMacAccessibilityElement *element = [QMacAccessibilityElement elementWithId: event->uniqueId()];
if (!element) {