summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2012-01-04 13:29:42 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-05 03:49:45 +0100
commitf599b5cd30a18e57e34cd9b5ffe6c80e4d2c902e (patch)
tree67eae0afbf9369ea8f1ea8ba507009a349b7a24f /tests
parentca81ec03d69817e838c7758844184447f530e0f6 (diff)
downloadqtbase-f599b5cd30a18e57e34cd9b5ffe6c80e4d2c902e.tar.gz
Fix memory leak in QAbstractItemModel autotest.
The test was allocating a new model on the heap each time init() was invoked, but none of these models were deleted. Change-Id: Ibe107b2dbc949a5f72940f67c08f4b0f46256c09 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
index 88b61395a2..ebf82227a1 100644
--- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
@@ -59,6 +59,7 @@ class tst_QAbstractItemModel : public QObject
public slots:
void initTestCase();
void init();
+ void cleanup();
private slots:
void index();
@@ -275,6 +276,11 @@ void tst_QAbstractItemModel::init()
insertCommand->doCommand();
}
+void tst_QAbstractItemModel::cleanup()
+{
+ delete m_model;
+}
+
/*
tests
*/