Close child windows and dialogs with main window

Most child windows should be closed with the main application
window otherwise if left open and if making specific
modifictions could potentially cause a SIGSEGV.

To solve that we mark all custom windows/dialogs with
the Qt::WA_QuitOnClose attribute on instance creation.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2013-06-28 15:20:42 +03:00 committed by Dirk Hohndel
parent 233e245b78
commit 880b8394d2
6 changed files with 6 additions and 0 deletions

View file

@ -9,6 +9,7 @@
SubsurfaceAbout *SubsurfaceAbout::instance()
{
static SubsurfaceAbout *self = new SubsurfaceAbout();
self->setAttribute(Qt::WA_QuitOnClose, false);
return self;
}

View file

@ -26,6 +26,7 @@ void DiveComputerManagementDialog::init()
DiveComputerManagementDialog* DiveComputerManagementDialog::instance()
{
static DiveComputerManagementDialog *self = new DiveComputerManagementDialog();
self->setAttribute(Qt::WA_QuitOnClose, false);
return self;
}

View file

@ -37,6 +37,7 @@ namespace DownloadFromDcGlobal{
DownloadFromDCWidget *DownloadFromDCWidget::instance()
{
static DownloadFromDCWidget *dialog = new DownloadFromDCWidget();
dialog->setAttribute(Qt::WA_QuitOnClose, false);
return dialog;
}

View file

@ -298,6 +298,7 @@ void MainWindow::on_actionYearlyStatistics_triggered()
view->setModel(model);
view->setWindowModality(Qt::NonModal);
view->setMinimumWidth(600);
view->setAttribute(Qt::WA_QuitOnClose, false);
view->show();
}

View file

@ -6,6 +6,7 @@
PreferencesDialog* PreferencesDialog::instance()
{
static PreferencesDialog *dialog = new PreferencesDialog();
dialog->setAttribute(Qt::WA_QuitOnClose, false);
return dialog;
}

View file

@ -19,6 +19,7 @@ static gboolean merge_locations_into_dives(void);
SubsurfaceWebServices* SubsurfaceWebServices::instance()
{
static SubsurfaceWebServices *self = new SubsurfaceWebServices();
self->setAttribute(Qt::WA_QuitOnClose, false);
return self;
}