forked from qt-creator/qt-creator
Avoid crash on qmljs plugin unload
The unload of qmljs plugin caused qmljs code style settings to be deleted, while core still had a pointer to them and used it afterwards. Added unregisterCodeStyle* methods for symmetry and used them on plugin destruction. Change-Id: I49f0fc52f3e71d053e6ada604672a4cc3eafa486 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -159,6 +159,11 @@ QmlJSToolsSettings::QmlJSToolsSettings(QObject *parent)
|
||||
|
||||
QmlJSToolsSettings::~QmlJSToolsSettings()
|
||||
{
|
||||
TextEditor::TextEditorSettings *textEditorSettings = TextEditor::TextEditorSettings::instance();
|
||||
textEditorSettings->unregisterCodeStyle(QmlJSTools::Constants::QML_JS_SETTINGS_ID);
|
||||
textEditorSettings->unregisterCodeStylePool(QmlJSTools::Constants::QML_JS_SETTINGS_ID);
|
||||
textEditorSettings->unregisterCodeStyleFactory(QmlJSTools::Constants::QML_JS_SETTINGS_ID);
|
||||
|
||||
delete m_globalCodeStyle;
|
||||
m_globalCodeStyle = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user