fix memory leak of QAccessibleWidget

in topLevelObjects() we should use "root->object()" instead of
"w->accessibleRoot()->object() to get the object attached to the
accessible interface. This is because "w->accessibleRoot()"
will create a new QAccessibleWidget(or its subclass) object
and this object is never released.

Change-Id: I34292b467b51d6cc439f0a1a45cd74d5f8a6a5a8
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
This commit is contained in:
Jian Liang 2012-02-01 14:24:00 +08:00 committed by Qt by Nokia
parent d1950d8e52
commit fe999022af

View File

@ -202,7 +202,7 @@ static QObjectList topLevelObjects()
if (w->windowType() != Qt::Popup && w->windowType() != Qt::Desktop) {
if (QAccessibleInterface *root = w->accessibleRoot()) {
if (root->object())
list.append(w->accessibleRoot()->object());
list.append(root->object());
delete root;
}
}