Index: src/libchcore/TSubTaskArray.cpp =================================================================== diff -u -N -r121d674474766192b5bf02afda67fb962635f56b -ree9b975618a07beb840aca724732da87b522d54b --- src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 121d674474766192b5bf02afda67fb962635f56b) +++ src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision ee9b975618a07beb840aca724732da87b522d54b) @@ -104,8 +104,7 @@ { m_oidSubOperationIndex.store(0, boost::memory_order_release); - std::pair tupleRow; - BOOST_FOREACH(tupleRow, m_vSubTasks) + for(const std::pair& tupleRow : m_vSubTasks) { if(tupleRow.first == NULL) THROW_CORE_EXCEPTION(eErr_InternalProblem); Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -N -r121d674474766192b5bf02afda67fb962635f56b -ree9b975618a07beb840aca724732da87b522d54b --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 121d674474766192b5bf02afda67fb962635f56b) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision ee9b975618a07beb840aca724732da87b522d54b) @@ -554,13 +554,20 @@ return TSubTaskBase::eSubResult_Continue; } - // ullSeekTo (== m_tSubTaskStats.GetCurrentItemProcessedSize()) is already a part of stats - // so the only correction that might need to be done is subtracting the difference - // between stored last file position (aka ullSeekTo) and the real position - // to which the file pos was set to. - m_tSubTaskStats.SetCurrentItemProcessedSize(ullMove); - if(ullMove < ullSeekTo) - m_tSubTaskStats.DecreaseProcessedSize(ullSeekTo - ullMove); + // adjust the stats for the difference between what was already processed and what will now be considered processed + unsigned long long ullCurrentProcessedSize = m_tSubTaskStats.GetCurrentItemProcessedSize(); + if (ullMove > ullCurrentProcessedSize) + { + unsigned long long ullDiff = ullMove - ullCurrentProcessedSize; + m_tSubTaskStats.IncreaseCurrentItemProcessedSize(ullDiff); + m_tSubTaskStats.IncreaseProcessedSize(ullDiff); + } + else if (ullMove < ullCurrentProcessedSize) + { + unsigned long long ullDiff = ullCurrentProcessedSize - ullMove; + m_tSubTaskStats.DecreaseCurrentItemProcessedSize(ullDiff); + m_tSubTaskStats.DecreaseProcessedSize(ullDiff); + } } // if the destination file already exists - truncate it to the current file position Index: src/libchcore/TTask.cpp =================================================================== diff -u -N -r121d674474766192b5bf02afda67fb962635f56b -ree9b975618a07beb840aca724732da87b522d54b --- src/libchcore/TTask.cpp (.../TTask.cpp) (revision 121d674474766192b5bf02afda67fb962635f56b) +++ src/libchcore/TTask.cpp (.../TTask.cpp) (revision ee9b975618a07beb840aca724732da87b522d54b) @@ -541,7 +541,7 @@ // if the files cache is not completely read - clean it up if(!m_tSubTaskContext.GetFilesCache().IsComplete()) - m_tSubTaskContext.GetFilesCache().Clear(); // get rid of m_files contents; rare state not modified, since incomplete cache is not being stored + m_tSubTaskContext.GetFilesCache().Clear(); // scanning for files did not finish processing, so the content of the files cache are useless // save progress before killed Store();