Commit 164ec20b authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed crash on applying or changing settings

The m_page member used to access the widgets was deleted too early.
Deletion moved to finish() method.
parent 66e9410f
......@@ -116,8 +116,6 @@ QWidget *ShortcutSettings::createPage(QWidget *parent)
commandChanged(0);
delete m_page;
return w;
}
......@@ -131,6 +129,8 @@ void ShortcutSettings::finish()
{
qDeleteAll(m_scitems);
m_scitems.clear();
delete m_page;
}
bool ShortcutSettings::eventFilter(QObject *o, QEvent *e)
......
......@@ -77,7 +77,7 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
this, SLOT(resetExternalEditor()));
connect(m_page->helpExternalEditorButton, SIGNAL(clicked()),
this, SLOT(showHelpForExternalEditor()));
delete m_page;
return w;
}
......@@ -88,6 +88,11 @@ void GeneralSettings::apply()
EditorManager::instance()->setExternalEditor(m_page->externalEditorEdit->text());
}
void GeneralSettings::finish()
{
delete m_page;
}
void GeneralSettings::resetInterfaceColor()
{
m_page->colorButton->setColor(0x666666);
......
......@@ -56,7 +56,7 @@ public:
QString trCategory() const;
QWidget* createPage(QWidget *parent);
void apply();
void finish() { }
void finish();
private slots:
void resetInterfaceColor();
......
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