From 543486a41963f8d20d9771d2107cdd5a22894bdb Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 25 Mar 2013 15:55:40 +0100 Subject: 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 --- src/corelib/io/qnoncontiguousbytedevice.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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; } -- cgit v0.12