diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 8c1bfc8c48f..564a3e5f51f 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -1288,7 +1288,6 @@ bool QResourceFileEngine::close() { Q_D(QResourceFileEngine); d->offset = 0; - d->uncompressed.clear(); return true; } diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp index 6461e6274f6..0b50c391b87 100644 --- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp +++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp @@ -410,6 +410,10 @@ void tst_QResourceEngine::checkStructure() QVERIFY2(ptr, qPrintable(file.errorString())); QByteArray ba = QByteArray::fromRawData(reinterpret_cast(ptr), file.size()); QCOMPARE(ba, contents); + + // check that it is still valid after closing the file + file.close(); + QCOMPARE(ba, contents); } QLocale::setDefault(QLocale::system()); }