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:
@@ -135,12 +135,14 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type
|
||||
{
|
||||
if (type.message() != MemoryAllocation) {
|
||||
if (type.rangeType() != MaximumRangeType) {
|
||||
m_continuation = ContinueNothing;
|
||||
if (event.rangeStage() == RangeStart)
|
||||
m_rangeStack.push(RangeStackFrame(event.typeIndex(), event.timestamp()));
|
||||
else if (event.rangeStage() == RangeEnd)
|
||||
else if (event.rangeStage() == RangeEnd) {
|
||||
QTC_ASSERT(!m_rangeStack.isEmpty(), return);
|
||||
QTC_ASSERT(m_rangeStack.top().originTypeIndex == event.typeIndex(), return);
|
||||
m_rangeStack.pop();
|
||||
|
||||
m_continuation = ContinueNothing;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user