Commit 0765a981 authored by con's avatar con
Browse files

Fix potential crash when closing settings dialog.

We accessed the m_applied member after the dialog already was deleted.

Task-number: QTCREATORBUG-2844
Reviewed-by: Friedemann Kleint
parent a015eb53
...@@ -314,7 +314,6 @@ SettingsDialog::SettingsDialog(QWidget *parent) : ...@@ -314,7 +314,6 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
m_proxyModel, SLOT(setFilterFixedString(QString))); m_proxyModel, SLOT(setFilterFixedString(QString)));
connect(m_filterLineEdit, SIGNAL(filterChanged(QString)), this, SLOT(filter(QString))); connect(m_filterLineEdit, SIGNAL(filterChanged(QString)), this, SLOT(filter(QString)));
m_categoryList->setFocus(); m_categoryList->setFocus();
setAttribute(Qt::WA_DeleteOnClose);
} }
void SettingsDialog::showPage(const QString &categoryId, const QString &pageId) void SettingsDialog::showPage(const QString &categoryId, const QString &pageId)
...@@ -522,6 +521,11 @@ bool SettingsDialog::execDialog() ...@@ -522,6 +521,11 @@ bool SettingsDialog::execDialog()
if (!m_running) { if (!m_running) {
m_running = true; m_running = true;
exec(); exec();
m_running = false;
m_instance = 0;
// make sure that the current "single" instance is deleted
// we can't delete right away, since we still access the m_applied member
deleteLater();
} else { } else {
// exec dialog is called while the instance is already running // exec dialog is called while the instance is already running
// this can happen when a event triggers a code path that wants to // this can happen when a event triggers a code path that wants to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment