summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qnoncontiguousbytedevice.cpp
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@blackberry.com>2013-03-25 14:55:40 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-26 15:07:04 (GMT)
commit543486a41963f8d20d9771d2107cdd5a22894bdb (patch)
tree8e24ade772a99c50c7327c115577c3c4157f8746 /src/corelib/io/qnoncontiguousbytedevice.cpp
parentd15eb9894e3faa21ee9d16faaad36e7f8896357e (diff)
downloadQt-543486a41963f8d20d9771d2107cdd5a22894bdb.zip
Qt-543486a41963f8d20d9771d2107cdd5a22894bdb.tar.gz
Qt-543486a41963f8d20d9771d2107cdd5a22894bdb.tar.bz2
QNonContiguousByteDevice: roll back complete internal state in reset()
... otherwise we would not start reading from the beginning when the device was reset. Change-Id: I897adbad6e1f240fa871758ec7e3d6b499cb5944 (cherry-picked from commit ffe45f1896adfff93258b917f6a566dcc06a6597) Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/corelib/io/qnoncontiguousbytedevice.cpp')
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index 904337b..724ba22 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -393,6 +393,12 @@ bool QNonContiguousByteDeviceIoDeviceImpl::reset()
if (device->seek(initialPosition)) {
eof = false; // assume eof is false, it will be true after a read has been attempted
totalAdvancements = 0; //reset the progress counter
+ if (currentReadBuffer) {
+ delete currentReadBuffer;
+ currentReadBuffer = 0;
+ }
+ currentReadBufferAmount = 0;
+ currentReadBufferPosition = 0;
return true;
}