diff options
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerengine.cpp | 14 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerengine.h | 1 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.cpp | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 3489ed1d1c..2862dd184f 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -73,6 +73,7 @@ public: QProcess *m_process; bool m_running; bool m_fetchingData; + bool m_delayedDelete; }; QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration) @@ -83,6 +84,7 @@ QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp d->m_process = 0; d->m_running = false; d->m_fetchingData = false; + d->m_delayedDelete = false; } QmlProfilerEngine::~QmlProfilerEngine() @@ -96,14 +98,18 @@ void QmlProfilerEngine::start() { d->launchperfmonitor(); d->m_running = true; + d->m_delayedDelete = false; emit processRunning(); } void QmlProfilerEngine::stop() { - if (d->m_fetchingData) + if (d->m_fetchingData) { + if (d->m_running) + d->m_delayedDelete = true; emit stopRecording(); + } else finishProcess(); } @@ -120,6 +126,12 @@ void QmlProfilerEngine::setFetchingData(bool b) d->m_fetchingData = b; } +void QmlProfilerEngine::dataReceived() { + if (d->m_delayedDelete) + finishProcess(); + d->m_delayedDelete = false; +} + void QmlProfilerEngine::finishProcess() { if (d->m_running) { diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.h b/src/plugins/qmlprofiler/qmlprofilerengine.h index 5fc49aa7cc..4d8dcb8a51 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.h +++ b/src/plugins/qmlprofiler/qmlprofilerengine.h @@ -58,6 +58,7 @@ public slots: void spontaneousStop(); void setFetchingData(bool); + void dataReceived(); void finishProcess(); private: diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 601a73ceaf..8e592e6a88 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -182,7 +182,7 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp connect(engine, SIGNAL(processRunning()), this, SLOT(connectClient())); connect(engine, SIGNAL(finished()), this, SLOT(disconnectClient())); connect(engine, SIGNAL(stopRecording()), this, SLOT(stopRecording())); - connect(d->m_traceWindow, SIGNAL(viewUpdated()), engine, SLOT(finishProcess())); + connect(d->m_traceWindow, SIGNAL(viewUpdated()), engine, SLOT(dataReceived())); connect(this, SIGNAL(connectionFailed()), engine, SLOT(finishProcess())); connect(this, SIGNAL(fetchingData(bool)), engine, SLOT(setFetchingData(bool))); emit fetchingData(d->m_recordButton->isChecked()); |