forked from qt-creator/qt-creator
CMakePM: Fix order of initialization
CMakeToolManager instance must be created first to avoid connects to a nullptr. Change-Id: If8738a26d58c80ffc9a63193240895f1bc9a87ae Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -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<CMakeProject>(Constants::CMAKEPROJECTMIMETYPE);
|
||||
|
||||
new CMakeToolManager(this);
|
||||
|
||||
//menus
|
||||
ActionContainer *msubproject =
|
||||
ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);
|
||||
|
@@ -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;
|
||||
|
@@ -40,7 +40,7 @@ class CMAKE_EXPORT CMakeToolManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CMakeToolManager(QObject *parent);
|
||||
CMakeToolManager();
|
||||
~CMakeToolManager() override;
|
||||
|
||||
static CMakeToolManager *instance();
|
||||
|
Reference in New Issue
Block a user