QmlProfiler: flush on new trace

Discard pending data if a new trace arrives while an old one
was still being processed.  If we don't, the data of both
traces gets mixed, leading to a possible crash.

Change-Id: Ibba7df06f6a4b7e93d00f6fa1fa4802baf3a1731
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2012-03-26 16:20:09 +02:00
parent 95e2c9ca57
commit 6ff4a0b586
3 changed files with 9 additions and 0 deletions

View File

@@ -123,6 +123,13 @@ void QmlProfilerClientManager::clearBufferedData()
d->v8clientplugin.data()->clearData();
}
void QmlProfilerClientManager::discardPendingData()
{
if (d->connection)
d->connection->flush();
clearBufferedData();
}
////////////////////////////////////////////////////////////////
// Internal
void QmlProfilerClientManager::connectClient(quint16 port)

View File

@@ -55,6 +55,7 @@ public:
void setOstConnection(QString ostDevice);
void clearBufferedData();
void discardPendingData();
signals:
void connectionFailed();

View File

@@ -476,6 +476,7 @@ void QmlProfilerTool::updateTimeDisplay()
void QmlProfilerTool::clearData()
{
d->m_profilerDataModel->clear();
d->m_profilerConnections->discardPendingData();
}
void QmlProfilerTool::clearDisplay()