Commit c933d423 authored by Fawzi Mohamed's avatar Fawzi Mohamed

basetexteditor/qmljseditor: fix destructor problem

solve problems depending on the destructor sequence:
- avoid setting code style to a destroyed code style
- avoid hiding a potentially destroyed pane
  (which will be cleared in any case)

Task-number: QTCREATORBUG-8818
Change-Id: Idd7817d99bf4ff04c5e152b00857f6e35825fd37
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent bb331b54
......@@ -532,7 +532,6 @@ QmlJSTextEditorWidget::QmlJSTextEditorWidget(QWidget *parent) :
QmlJSTextEditorWidget::~QmlJSTextEditorWidget()
{
hideContextPane();
m_semanticInfoUpdater->abort();
m_semanticInfoUpdater->wait();
}
......
......@@ -4614,9 +4614,12 @@ void BaseTextEditorWidget::onCodeStylePreferencesDestroyed()
{
if (sender() != d->m_codeStylePreferences)
return;
ICodeStylePreferences *prefs = TextEditorSettings::instance()->codeStyle(languageSettingsId());
if (prefs == d->m_codeStylePreferences)
prefs = 0;
// avoid failing disconnects, m_codeStylePreferences has already been reduced to QObject
d->m_codeStylePreferences = 0;
setCodeStyle(TextEditorSettings::instance()->codeStyle(languageSettingsId()));
setCodeStyle(prefs);
}
void BaseTextEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
......
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