fix memory leak of QAccessibleWidget
authorJian Liang <jianliang79@gmail.com>
Wed, 1 Feb 2012 06:24:00 +0000 (14:24 +0800)
committerQt by Nokia <qt-info@nokia.com>
Thu, 2 Feb 2012 08:27:25 +0000 (09:27 +0100)
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>
src/gui/accessible/qaccessibleobject.cpp

index 7e1a05b..b9e0ac3 100644 (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;
             }
         }