Hi, Do I have to delete objects from the heap in the example below? And if yes, how?
#include <QApplication>
#include <QTreeView>
#include <QListView>
#include <QTableView>
#include <QSplitter>
int main(int argc, char* argv[])
{
QApplication app(argc,argv);
QTreeView* tree = new QTreeView;
QListView* list = new QListView;
QTableView* table = new QTableView;
QSplitter* splitter = new QSplitter;
splitter->addWidget(tree);
splitter->addWidget(list);
splitter->addWidget(table);
splitter->show();
// delete splitter; WHEN TRYING TO DELETE I'M GETTING INFO THAT app EXITED
// delete table; WITH CODE -1073741819
// delete list;
// delete tree;
return app.exec();
}
Thank you for any help.