summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-08-08 15:11:23 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-08-08 13:58:42 +0000
commitff9e55d5fb1867a9aff74673d8a08d0cba2cb900 (patch)
tree0ca8f80b3a8434f10c53754f5019b567f01ed2c9
parenta028f6717f0e183f3a16361c9b07b190edac57b3 (diff)
downloadqt-creator-ff9e55d5fb1867a9aff74673d8a08d0cba2cb900.tar.gz
QmlProfiler: Use stop dependencies for RunWorkers
Change-Id: If4d0af85c6e537e6d9a35dc877f7542c91a2bc13 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
index 7456c6efae..2dec1be147 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
@@ -133,7 +133,7 @@ void QmlProfilerRunner::stop()
switch (d->m_profilerState->currentState()) {
case QmlProfilerStateManager::AppRunning:
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppStopRequested);
- break;
+ return; // Don't reportStopped() here. We are still waiting for data.
case QmlProfilerStateManager::AppStopRequested:
// Pressed "stop" a second time. Kill the application without collecting data
d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle);
@@ -257,6 +257,7 @@ void QmlProfilerRunner::profilerStateChanged()
switch (d->m_profilerState->currentState()) {
case QmlProfilerStateManager::Idle:
d->m_noDebugOutputTimer.stop();
+ reportStopped();
break;
default:
break;
@@ -309,6 +310,7 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
m_profiler = new QmlProfilerRunner(runControl);
m_profiler->setServerUrl(serverUrl);
m_profiler->addStartDependency(this);
+ addStopDependency(m_profiler);
StandardRunnable debuggee = runnable().as<StandardRunnable>();
QString arguments = QmlDebug::qmlDebugArguments(QmlDebug::QmlProfilerServices, serverUrl);
@@ -322,6 +324,7 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
m_profilee = new SimpleTargetRunner(runControl);
m_profilee->setRunnable(debuggee);
addStartDependency(m_profilee);
+ m_profilee->addStopDependency(this);
}
void LocalQmlProfilerSupport::start()