forked from qt-creator/qt-creator
ExtraCompiler: Parent extra compilers to plugins
Previously the extra compilers were never destructed. As any plugin that registers an extra compiler factory has to depend on ProjectExplorer, it will delete its factory before ProjectExplorer is unloaded. So, removing the extra compiler from the list on destroyed() is safe. Change-Id: I22fbe662a5704c0294512b8774acb85745c1cbe5 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -354,7 +354,11 @@ ExtraCompilerFactory::ExtraCompilerFactory(QObject *parent) : QObject(parent)
|
||||
|
||||
void ExtraCompilerFactory::registerExtraCompilerFactory(ExtraCompilerFactory *factory)
|
||||
{
|
||||
factories()->append(factory);
|
||||
QList<ExtraCompilerFactory *> *factoryList = factories();
|
||||
factoryList->append(factory);
|
||||
connect(factory, &QObject::destroyed, [factoryList, factory]() {
|
||||
factoryList->removeAll(factory);
|
||||
});
|
||||
}
|
||||
|
||||
QList<ExtraCompilerFactory *> ExtraCompilerFactory::extraCompilerFactories()
|
||||
|
||||
Reference in New Issue
Block a user