diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index d4a3d27f873..e703aefb31b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -62,6 +62,8 @@ namespace Internal { class CMakeProjectPluginPrivate { public: + CMakeToolManager cmakeToolManager; // have that before the first CMakeKitAspect + Utils::ParameterAction *m_buildTargetContextAction = nullptr; QMetaObject::Connection m_actionConnect; @@ -112,8 +114,6 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString * tr("CMake", "SnippetProvider")); ProjectManager::registerProjectType(Constants::CMAKEPROJECTMIMETYPE); - new CMakeToolManager(this); - //menus ActionContainer *msubproject = ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT); diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index a90fe59c810..24ccc2b2ef5 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -57,7 +57,7 @@ static CMakeToolManagerPrivate *d = nullptr; CMakeToolManager *CMakeToolManager::m_instance = nullptr; -CMakeToolManager::CMakeToolManager(QObject *parent) : QObject(parent) +CMakeToolManager::CMakeToolManager() { QTC_ASSERT(!m_instance, return); m_instance = this; diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h index bd7f232553c..0ee394ba0c1 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h @@ -40,7 +40,7 @@ class CMAKE_EXPORT CMakeToolManager : public QObject { Q_OBJECT public: - CMakeToolManager(QObject *parent); + CMakeToolManager(); ~CMakeToolManager() override; static CMakeToolManager *instance();