Example: fix memory leak in relationnaltablemodel example

The example creates a view on the heap but doesn't delete it on
application end. This patch uses a QScopedPointer to fix that.

Change-Id: I3b0c8589999d243c193bd02e1470c03eabfabe40
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
This commit is contained in:
Samuel Gaist 2017-03-07 21:52:58 +01:00
parent 895b4e6f89
commit 9e933de7f2

View File

@ -117,7 +117,7 @@ int main(int argc, char *argv[])
initializeModel(&model);
QTableView *view = createView(QObject::tr("Relational Table Model"), &model);
QScopedPointer<QTableView> view(createView(QObject::tr("Relational Table Model"), &model));
view->show();
return app.exec();