diff options
| author | Ulf Hermann <[email protected]> | 2018-05-22 14:39:11 +0200 |
|---|---|---|
| committer | Ulf Hermann <[email protected]> | 2018-05-22 13:41:55 +0000 |
| commit | dd9c7de89a8bf876d3d7f7e98c55ac428539a4c8 (patch) | |
| tree | 631dd42f89d0d56369a3c6665f84586ddbf80ef0 /src | |
| parent | c0b8ac7966065afbab9511474b4fa38748d0ca84 (diff) | |
Tracing: Fix past-end handling in TraceStashFile::Iterator
If we read past the end of the stream in open() or next() we don't want
to process the resulting event. This fixes the QmlProfilerTraceClient
test.
Change-Id: Iaaa60f462aa588096001579efae7ed1a88d6d6a3
Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/libs/tracing/tracestashfile.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libs/tracing/tracestashfile.h b/src/libs/tracing/tracestashfile.h index f8096e08fe0..c3443e13001 100644 --- a/src/libs/tracing/tracestashfile.h +++ b/src/libs/tracing/tracestashfile.h @@ -75,10 +75,13 @@ public: { if (readFile->open(QIODevice::ReadOnly)) { readStream->setDevice(readFile.get()); - if (readStream->atEnd()) + if (readStream->atEnd()) { streamAtEnd = true; - else + } else { (*readStream) >> nextEvent; + if (readPastEnd()) + streamAtEnd = true; + } return true; } streamAtEnd = true; @@ -107,6 +110,8 @@ public: const Event result = std::move(nextEvent); (*readStream) >> nextEvent; + if (readPastEnd()) + streamAtEnd = true; return result; } |
