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>
This commit is contained in:
Ulf Hermann
2015-04-14 15:17:30 +02:00
parent 24eea82477
commit e11965b3aa

View File

@@ -39,7 +39,7 @@ QmlProfilerTimelineModel::QmlProfilerTimelineModel(QmlProfilerModelManager *mode
TimelineModel(modelManager->registerModelProxy(), displayName, parent), m_message(message), TimelineModel(modelManager->registerModelProxy(), displayName, parent), m_message(message),
m_rangeType(rangeType), m_modelManager(modelManager) m_rangeType(rangeType), m_modelManager(modelManager)
{ {
connect(modelManager->qmlModel(), &QmlProfilerDataModel::changed, connect(modelManager, &QmlProfilerModelManager::stateChanged,
this, &QmlProfilerTimelineModel::dataChanged); this, &QmlProfilerTimelineModel::dataChanged);
} }
@@ -91,7 +91,7 @@ void QmlProfilerTimelineModel::dataChanged()
{ {
switch (m_modelManager->state()) { switch (m_modelManager->state()) {
case QmlProfilerDataState::ProcessingData: case QmlProfilerDataState::Done:
loadData(); loadData();
emit emptyChanged(); emit emptyChanged();
break; break;