{
LoadingThread::State thread_state = thread.get_state();
bool check_total_size = false;
- if(thread_state==LoadingThread::SYNC_PENDING)
+ if(thread_state==LoadingThread::SYNC_PENDING || thread_state==LoadingThread::LOAD_FINISHED)
{
thread.sync();
check_total_size = true;
if(i->second.loaded && i->second.last_used<unload_limit)
{
UInt64 impact = i->second.data_size*(frame-i->second.last_used);
- if(!best || impact<best_impact)
+ if(!best || impact>best_impact)
{
best = &i->second;
best_impact = impact;