mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 04:39:51 +02:00
PR feedback
This commit is contained in:
parent
a675dfe7d2
commit
1632e3b35a
1 changed files with 4 additions and 2 deletions
|
@ -285,10 +285,12 @@ void FileCache::wipe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileCache::clear() {
|
void FileCache::clear() {
|
||||||
|
Lock lock(_mutex);
|
||||||
|
|
||||||
// Eliminate any overbudget files
|
// Eliminate any overbudget files
|
||||||
clean();
|
clean();
|
||||||
|
|
||||||
// Mark everything remaining as persisted
|
// Mark everything remaining as persisted while effectively ejecting from the cache
|
||||||
for (auto& file : _unusedFiles) {
|
for (auto& file : _unusedFiles) {
|
||||||
file->_shouldPersist = true;
|
file->_shouldPersist = true;
|
||||||
file->_cache = nullptr;
|
file->_cache = nullptr;
|
||||||
|
@ -323,4 +325,4 @@ File::~File() {
|
||||||
void File::touch() {
|
void File::touch() {
|
||||||
utime(_filepath.c_str(), nullptr);
|
utime(_filepath.c_str(), nullptr);
|
||||||
_modified = std::max<int64_t>(QFileInfo(_filepath.c_str()).lastRead().toMSecsSinceEpoch(), _modified);
|
_modified = std::max<int64_t>(QFileInfo(_filepath.c_str()).lastRead().toMSecsSinceEpoch(), _modified);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue