From fe999022af36f01455b8d6f4dfff6eff473a4376 Mon Sep 17 00:00:00 2001 From: Jian Liang Date: Wed, 1 Feb 2012 14:24:00 +0800 Subject: [PATCH] fix memory leak of QAccessibleWidget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/accessible/qaccessibleobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index 7e1a05b2a0..b9e0ac388b 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -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; } }