From c3b6c04245190f0aa17cae7b4c57f5b5052f3e97 Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Thu, 13 Dec 2012 14:23:44 +0100 Subject: [PATCH] Fix memory leak in childAt Delete the interface if it's not returned. Change-Id: Ia1e1f94d14584ab3af1b89a0baac5d343ffdd1f4 Reviewed-by: Frederik Gladhorn --- src/gui/accessible/qaccessibleobject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index bc108980cf..2bd5a00afb 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -165,6 +165,8 @@ QAccessibleInterface *QAccessibleObject::childAt(int x, int y) const Q_ASSERT(childIface); if (childIface->rect().contains(x,y)) { return childIface; + } else { + delete childIface; } } return 0;