From e11965b3aacf9795bd99689ce38b55dbe2a92885 Mon Sep 17 00:00:00 2001 From: Ulf Hermann <ulf.hermann@theqtcompany.com> Date: Tue, 14 Apr 2015 15:17:30 +0200 Subject: [PATCH] QmlProfiler: Clear timeline models before clearing the base model. The model manager's stateChanged() signal gives us accurate information on when the clearing begins so that we can clear the timeline models as first thing, not as last. Clearing them as last thing can indirectly prompt them to access now invalid data of the base model, such as the types. Change-Id: I3af4a6716ed8b2efb433e7a264d3fc9a65f61490 Task-number: QTCREATORBUG-14277 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> --- src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp index b2411a5da8e..7bdaa119bf3 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp @@ -39,7 +39,7 @@ QmlProfilerTimelineModel::QmlProfilerTimelineModel(QmlProfilerModelManager *mode TimelineModel(modelManager->registerModelProxy(), displayName, parent), m_message(message), m_rangeType(rangeType), m_modelManager(modelManager) { - connect(modelManager->qmlModel(), &QmlProfilerDataModel::changed, + connect(modelManager, &QmlProfilerModelManager::stateChanged, this, &QmlProfilerTimelineModel::dataChanged); } @@ -91,7 +91,7 @@ void QmlProfilerTimelineModel::dataChanged() { switch (m_modelManager->state()) { - case QmlProfilerDataState::ProcessingData: + case QmlProfilerDataState::Done: loadData(); emit emptyChanged(); break; -- GitLab