Fixed status check order in garbage collection process
This commit is contained in:
parent
3164a6c502
commit
f8f13f464c
1 changed files with 4 additions and 4 deletions
|
|
@ -678,12 +678,15 @@ void sfz::FilePool::triggerGarbageCollection() noexcept
|
|||
|
||||
sfz::FileData& data = it->second;
|
||||
|
||||
if (data.readerCount != 0)
|
||||
return false;
|
||||
|
||||
auto status = data.status.load();
|
||||
if (data.availableFrames == 0) {
|
||||
return status == FileData::Status::Preloaded || status == FileData::Status::FullLoaded;
|
||||
}
|
||||
|
||||
switch (status) {
|
||||
switch(status) {
|
||||
case FileData::Status::Invalid:
|
||||
case FileData::Status::Streaming:
|
||||
return false;
|
||||
|
|
@ -691,9 +694,6 @@ void sfz::FilePool::triggerGarbageCollection() noexcept
|
|||
break;
|
||||
}
|
||||
|
||||
if (data.readerCount != 0)
|
||||
return false;
|
||||
|
||||
const auto secondsIdle = std::chrono::duration_cast<std::chrono::seconds>(now - data.lastViewerLeftAt).count();
|
||||
if (secondsIdle < config::fileClearingPeriod)
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue