diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2012-01-04 13:29:42 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-05 03:49:45 +0100 |
commit | f599b5cd30a18e57e34cd9b5ffe6c80e4d2c902e (patch) | |
tree | 67eae0afbf9369ea8f1ea8ba507009a349b7a24f /tests | |
parent | ca81ec03d69817e838c7758844184447f530e0f6 (diff) | |
download | qtbase-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.cpp | 6 |
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 */ |