aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-01-03 13:40:48 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-01-03 13:51:47 +0000
commit4a5bd323a9bc9c2de44e92f8414ed283feb314b1 (patch)
treebb3968d1868ae1f2b0557250894d3e8ac48c4d3a /src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
parentffe120a43ff93e9ba0b37e987496c886c3274ad9 (diff)
QmlProfiler: Retain event types between sessions on same connection
The server won't re-send the event types. We need to keep them until the connection goes away. Otherwise we get invalid event types and soft asserts when trying to look up event types for new events. Also, when clearing the event types, also clear the server type IDs. Not clearing those constitutes a memory leak. Change-Id: I564b0c4cf0ed754549d2b8ede63c97fa01affcec Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
index 7c85817841..687ad50db5 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
@@ -691,9 +691,8 @@ QmlProfilerModelManager::State QmlProfilerModelManager::state() const
return d->state;
}
-void QmlProfilerModelManager::clear()
+void QmlProfilerModelManager::doClearEvents()
{
- setState(ClearingData);
d->numLoadedEvents = 0;
d->numFinishedFinalizers = 0;
d->file.remove();
@@ -702,13 +701,25 @@ void QmlProfilerModelManager::clear()
d->eventStream.setDevice(&d->file);
else
emit error(tr("Cannot open temporary trace file to store events."));
- d->eventTypes.clear();
- d->detailsRewriter->clear();
d->traceTime->clear();
d->notesModel->clear();
setVisibleFeatures(0);
setRecordedFeatures(0);
+}
+void QmlProfilerModelManager::clearEvents()
+{
+ setState(ClearingData);
+ doClearEvents();
+ setState(Empty);
+}
+
+void QmlProfilerModelManager::clear()
+{
+ setState(ClearingData);
+ doClearEvents();
+ d->eventTypes.clear();
+ d->detailsRewriter->clear();
setState(Empty);
}