diff options
author | Christiaan Janssen <[email protected]> | 2012-03-26 16:20:09 +0200 |
---|---|---|
committer | Christiaan Janssen <[email protected]> | 2012-03-26 16:46:41 +0200 |
commit | 6ff4a0b58668ff572a1942405161e2db98238b87 (patch) | |
tree | 99422bba2d43338dcdc88bfd0b53270816976e7f /src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp | |
parent | 95e2c9ca5725e6c35f4e02d8c9ee24f4f0f4499a (diff) |
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 <[email protected]>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index 01a0d787a2d..a9002aa85b8 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -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) |