forked from qt-creator/qt-creator
QmlProfiler: Add some sanity checks to the various models
If we pop an event from the stack, then it should be the same type we pushed earlier. Change-Id: If4389cb57fa8996b3772fefca92d27c33dc35c65 Task-number: QTCREATORBUG-17885 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -225,7 +225,8 @@ void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEvent
|
||||
break;
|
||||
case RangeEnd: {
|
||||
// update stats
|
||||
|
||||
QTC_ASSERT(!stack.isEmpty(), return);
|
||||
QTC_ASSERT(stack.top().typeIndex() == event.typeIndex(), return);
|
||||
QmlEventStats *stats = &d->data[event.typeIndex()];
|
||||
qint64 duration = event.timestamp() - stack.top().timestamp();
|
||||
stats->duration += duration;
|
||||
|
||||
Reference in New Issue
Block a user