Do not crash in the bridge because of inconsistent hierarchy

Change-Id: I732b624b9918ff4ab59ef46322fd42167b438a8d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
bb10
Jan Arve Saether 2012-12-20 16:04:17 +01:00 committed by The Qt Project
parent 1b47059c88
commit 25c6908c80
1 changed files with 4 additions and 2 deletions

View File

@ -767,9 +767,11 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accChild(VARIANT varChildI
// actually ask for the same object. As a consequence, we need to clone ourselves:
if (QAccessibleInterface *par = accessible->parent()) {
const int indexOf = par->indexOfChild(accessible);
QAccessibleInterface *clone = par->child(indexOf);
if (indexOf == -1)
qWarning() << "inconsistent hierarchy, parent:" << par << "child:" << accessible;
else
acc = par->child(indexOf);
delete par;
acc = clone;
}
}
}