THREADING_MODEL_WIN: Create a new CppCheck object for every file to be analysed in multi-thread mode. This fixes existing .a1 files not getting used due to changing hashes (caused by suppressions from previous files) and matches the behavior in THREADING_MODEL_FORK. (#3405)

This commit is contained in:
chrchr-github 2021-08-17 20:51:31 +02:00 committed by GitHub
parent 8700d1b86d
commit 187d45a8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -458,15 +458,15 @@ unsigned int __stdcall ThreadExecutor::threadProc(void *args)
// guard static members of CppCheck against concurrent access
EnterCriticalSection(&threadExecutor->mFileSync);
CppCheck fileChecker(*threadExecutor, false, CppCheckExecutor::executeCommand);
fileChecker.settings() = threadExecutor->mSettings;
for (;;) {
if (itFile == threadExecutor->mFiles.end() && itFileSettings == threadExecutor->mSettings.project.fileSettings.end()) {
LeaveCriticalSection(&threadExecutor->mFileSync);
break;
}
CppCheck fileChecker(*threadExecutor, false, CppCheckExecutor::executeCommand);
fileChecker.settings() = threadExecutor->mSettings;
std::size_t fileSize = 0;
if (itFile != threadExecutor->mFiles.end()) {
const std::string &file = itFile->first;