QResourceFileEngine: fix use of mapped files after close()
QFile::map() is documented to continue working after the QFile is closed, so this should work for the resource file engine too. Change-Id: I343f2beed55440a7ac0bfffd1563243a3966441f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
6a792d6f0b
commit
6b088b7a1d
@ -1288,7 +1288,6 @@ bool QResourceFileEngine::close()
|
||||
{
|
||||
Q_D(QResourceFileEngine);
|
||||
d->offset = 0;
|
||||
d->uncompressed.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -410,6 +410,10 @@ void tst_QResourceEngine::checkStructure()
|
||||
QVERIFY2(ptr, qPrintable(file.errorString()));
|
||||
QByteArray ba = QByteArray::fromRawData(reinterpret_cast<const char *>(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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user