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

@@ -92,15 +92,18 @@ public:
ICodeStylePreferencesFactory *codeStyleFactory(Core::Id languageId) const;
QMap<Core::Id, ICodeStylePreferencesFactory *> codeStyleFactories() const;
void registerCodeStyleFactory(ICodeStylePreferencesFactory *codeStyleFactory);
void unregisterCodeStyleFactory(Core::Id languageId);
CodeStylePool *codeStylePool() const;
CodeStylePool *codeStylePool(Core::Id languageId) const;
void registerCodeStylePool(Core::Id languageId, CodeStylePool *pool);
void unregisterCodeStylePool(Core::Id languageId);
ICodeStylePreferences *codeStyle() const;
ICodeStylePreferences *codeStyle(Core::Id languageId) const;
QMap<Core::Id, ICodeStylePreferences *> codeStyles() const;
void registerCodeStyle(Core::Id languageId, ICodeStylePreferences *prefs);
void unregisterCodeStyle(Core::Id languageId);
void registerMimeTypeForLanguageId(const QString &mimeType, Core::Id languageId);
Core::Id languageId(const QString &mimeType) const;