Pin File pointer during eject

This commit is contained in:
Atlante45 2017-07-18 13:29:03 -07:00
parent 758ae9825d
commit 497fd7f714
2 changed files with 3 additions and 2 deletions

View file

@ -258,7 +258,8 @@ namespace cache {
};
}
void FileCache::eject(const FilePointer& file) {
// Take file pointer by value to insure it doesn't get destructed during the "erase()" calls
void FileCache::eject(FilePointer file) {
file->_locked = false;
const auto& length = file->getLength();
const auto& key = file->getKey();

View file

@ -119,7 +119,7 @@ private:
void clean();
void clear();
// Remove a file from the cache
void eject(const FilePointer& file);
void eject(FilePointer file);
size_t getOverbudgetAmount() const;