diff options
-rw-r--r-- | src/plugins/perfprofiler/perfprofilerplugin.cpp | 3 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilerruncontrol.cpp | 15 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilerruncontrol.h | 6 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/plugins/perfprofiler/perfprofilerplugin.cpp b/src/plugins/perfprofiler/perfprofilerplugin.cpp index f7ac90eaa9a..1043d5026bd 100644 --- a/src/plugins/perfprofiler/perfprofilerplugin.cpp +++ b/src/plugins/perfprofiler/perfprofilerplugin.cpp @@ -25,7 +25,6 @@ public: RunConfiguration::registerAspect<PerfRunConfigurationAspect>(); } - PerfProfilerRunWorkerFactory profilerWorkerFactory; PerfProfilerTool profilerTool; }; @@ -36,6 +35,8 @@ PerfProfilerPlugin::~PerfProfilerPlugin() void PerfProfilerPlugin::initialize() { + setupPerfProfilerRunWorker(); + d = new PerfProfilerPluginPrivate; #if WITH_TESTS diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp index 1919547383d..64f0edaf6ff 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp @@ -205,10 +205,19 @@ void PerfProfilerRunner::start() // PerfProfilerRunWorkerFactory -PerfProfilerRunWorkerFactory::PerfProfilerRunWorkerFactory() +class PerfProfilerRunWorkerFactory final : public RunWorkerFactory { - setProduct<PerfProfilerRunner>(); - addSupportedRunMode(ProjectExplorer::Constants::PERFPROFILER_RUN_MODE); +public: + PerfProfilerRunWorkerFactory() + { + setProduct<PerfProfilerRunner>(); + addSupportedRunMode(ProjectExplorer::Constants::PERFPROFILER_RUN_MODE); + } +}; + +void setupPerfProfilerRunWorker() +{ + static PerfProfilerRunWorkerFactory thePerfProfilerRunWorkerFactory; } } // PerfProfiler::Internal diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.h b/src/plugins/perfprofiler/perfprofilerruncontrol.h index 4a027900420..9db8655f417 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.h +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.h @@ -23,10 +23,6 @@ private: ProjectExplorer::RunWorker *m_perfRecordWorker = nullptr; }; -class PerfProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory -{ -public: - PerfProfilerRunWorkerFactory(); -}; +void setupPerfProfilerRunWorker(); } // PerfProfiler::Internal |