diff options
| author | Eike Ziller <eike.ziller@qt.io> | 2025-11-03 10:44:59 +0100 |
|---|---|---|
| committer | Eike Ziller <eike.ziller@qt.io> | 2025-11-06 07:13:10 +0000 |
| commit | d06dc327d87b00e9a2d3555fec0ef03066be0a2b (patch) | |
| tree | 333daf83936354cb3871f74e0b2f939e27138321 | |
| parent | 7e6e3e5c1959c3dee7c4acf9eba12eabe348c2eb (diff) | |
Fix crash with attaching QML Profiler to waiting application
If there is no current run configuration (for example if no project is
opened).
In that case no device was set for the run control, but the device is
accessed in the portsGathererRecipe, which would then crash.
Change-Id: I495ad39d7809100315ba50dce800f38ba9ef3519
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: hjk <hjk@qt.io>
| -rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 4371d3fbdcd..689b205a7a9 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -558,8 +558,11 @@ RunControl *QmlProfilerTool::attachToWaitingApplication() d->m_viewContainer->perspective()->select(); auto runControl = new RunControl(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); - if (RunConfiguration *runConfig = activeRunConfigForActiveProject()) - runControl->copyDataFromRunConfiguration(runConfig); + RunConfiguration *activeRunConfig = activeRunConfigForActiveProject(); + if (activeRunConfig && activeRunConfig->kit() == kit) + runControl->copyDataFromRunConfiguration(activeRunConfig); + else + runControl->setKit(kit); runControl->setQmlChannel(serverUrl); runControl->setRunRecipe(qmlProfilerRecipe(runControl)); |
