From 34372ecde4a3d9794be9b92c5321849acf10cd28 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 24 Sep 2014 19:31:33 +0200 Subject: [PATCH] QmlProfiler: Prevent V8 model from reading unrelated trace data Change-Id: I2b079af208cfbe9969749847685da80fdff9be90 Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/qv8profilerdatamodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp b/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp index 9fa17bd71eb..07aa0bac4f8 100644 --- a/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp +++ b/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp @@ -380,7 +380,8 @@ void QV8ProfilerDataModel::load(QXmlStreamReader &stream) if (attributes.hasAttribute(QLatin1String("totalTime"))) d->v8MeasuredTime = attributes.value(QLatin1String("totalTime")).toString().toDouble(); - while (!stream.atEnd() && !stream.hasError()) { + bool finishedReading = false; + while (!stream.atEnd() && !stream.hasError() && !finishedReading) { QXmlStreamReader::TokenType token = stream.readNext(); const QStringRef elementName = stream.name(); switch (token) { @@ -456,6 +457,7 @@ void QV8ProfilerDataModel::load(QXmlStreamReader &stream) } case QXmlStreamReader::EndElement : { if (elementName == QLatin1String("v8profile")) { + finishedReading = true; // done reading the v8 profile data break; }