From 982fefe69d5fd679e473bd7826aaf78a56779610 Mon Sep 17 00:00:00 2001 From: Frank Meerkoetter Date: Mon, 28 Dec 2015 20:04:46 +0100 Subject: [PATCH] Cleanup memory owned by QTestTablePrivate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 7a42c8c15c59ef5fe84e6f293f2c97d38b85599c QTestTablePrivate no longer cleans up the memory it holds in dataList. This will make tools such as valgrind/address-sanitizer generate a lot of noise about directly or indirectly leaked memory. Change-Id: Ic0900ecdd7b76cda9f5366f3950bccde2f1b244c Reviewed-by: Jędrzej Nowacki --- src/testlib/qtesttable.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/testlib/qtesttable.cpp b/src/testlib/qtesttable.cpp index d20bdd8467..05cce37a47 100644 --- a/src/testlib/qtesttable.cpp +++ b/src/testlib/qtesttable.cpp @@ -46,6 +46,11 @@ QT_BEGIN_NAMESPACE class QTestTablePrivate { public: + ~QTestTablePrivate() + { + qDeleteAll(dataList.begin(), dataList.end()); + } + struct Element { Element() : name(Q_NULLPTR), type(0) {} Element(const char *n, int t) : name(n), type(t) {}