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>
This commit is contained in:
parent
ca81ec03d6
commit
f599b5cd30
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user