diff options
author | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2013-03-05 13:47:02 +0100 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2013-03-05 15:30:04 +0100 |
commit | c933d42370492db2e45178b03d204d19a923216b (patch) | |
tree | d5bedd66d87bbc5b5fc0cb3228864eb5292ab815 | |
parent | bb331b548fad2a336d613170540b92e3ff222ac1 (diff) |
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: Tobias Hunger <tobias.hunger@digia.com>
-rw-r--r-- | src/plugins/qmljseditor/qmljseditor.cpp | 1 | ||||
-rw-r--r-- | src/plugins/texteditor/basetexteditor.cpp | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 121b95e0bc..1314e98fed 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -532,7 +532,6 @@ QmlJSTextEditorWidget::QmlJSTextEditorWidget(QWidget *parent) : QmlJSTextEditorWidget::~QmlJSTextEditorWidget() { - hideContextPane(); m_semanticInfoUpdater->abort(); m_semanticInfoUpdater->wait(); } diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index ee04b52f4d..e4a2a5abd1 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -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 &) |