From 187d45a8dfd1c215461717bd37f7d0ad7e75c2f2 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 17 Aug 2021 20:51:31 +0200 Subject: [PATCH] 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) --- cli/threadexecutor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp index 918daaeba..c09c1459c 100644 --- a/cli/threadexecutor.cpp +++ b/cli/threadexecutor.cpp @@ -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;