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:
@@ -241,6 +241,11 @@ CppToolsSettings::~CppToolsSettings()
|
||||
{
|
||||
ExtensionSystem::PluginManager::removeObject(d->m_completionSettingsPage);
|
||||
|
||||
TextEditor::TextEditorSettings *textEditorSettings = TextEditor::TextEditorSettings::instance();
|
||||
textEditorSettings->unregisterCodeStyle(Constants::CPP_SETTINGS_ID);
|
||||
textEditorSettings->unregisterCodeStylePool(Constants::CPP_SETTINGS_ID);
|
||||
textEditorSettings->unregisterCodeStyleFactory(Constants::CPP_SETTINGS_ID);
|
||||
|
||||
delete d;
|
||||
|
||||
m_instance = 0;
|
||||
|
||||
Reference in New Issue
Block a user