Cleanup memory owned by QTestTablePrivate

Since 7a42c8c15c 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 <jedrzej.nowacki@theqtcompany.com>
This commit is contained in:
Frank Meerkoetter 2015-12-28 20:04:46 +01:00 committed by Jędrzej Nowacki
parent 83da3e5eda
commit 982fefe69d

View File

@ -46,6 +46,11 @@ QT_BEGIN_NAMESPACE
class QTestTablePrivate class QTestTablePrivate
{ {
public: public:
~QTestTablePrivate()
{
qDeleteAll(dataList.begin(), dataList.end());
}
struct Element { struct Element {
Element() : name(Q_NULLPTR), type(0) {} Element() : name(Q_NULLPTR), type(0) {}
Element(const char *n, int t) : name(n), type(t) {} Element(const char *n, int t) : name(n), type(t) {}