mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user