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:
jkobus
2013-03-11 13:21:57 +01:00
committed by Jarek Kobus
parent 37ff8f55a0
commit f4cfa822ff
4 changed files with 28 additions and 0 deletions

View File

@@ -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;