fix leaked ConfigDialog and memory errors

The ConfigDialog is modal, so it needs to delete itself.  However, the
existing code contained a bunch of destructors with calls to delete on
widgets.  That's wrong.  Widgets are automatically parented on being added to
layouts, the parent widgets delete their children in their own destructors.
So remove all the explicit deletes.
This commit is contained in:
Sean Rhea
2009-12-13 12:10:58 -05:00
parent db7f9a9ad2
commit ffc63d539a
4 changed files with 1 additions and 68 deletions

View File

@@ -26,6 +26,7 @@
ConfigDialog::ConfigDialog(QDir _home, Zones *_zones, MainWindow *mainWindow) :
mainWindow(mainWindow), zones(_zones)
{
setAttribute(Qt::WA_DeleteOnClose);
home = _home;
@@ -88,20 +89,6 @@ ConfigDialog::ConfigDialog(QDir _home, Zones *_zones, MainWindow *mainWindow) :
setWindowTitle(tr("Config Dialog"));
}
ConfigDialog::~ConfigDialog()
{
delete cyclistPage;
delete contentsWidget;
delete configPage;
delete devicePage;
delete pagesWidget;
delete closeButton;
delete horizontalLayout;
delete buttonsLayout;
delete mainLayout;
}
void ConfigDialog::createIcons()
{
QListWidgetItem *configButton = new QListWidgetItem(contentsWidget);