Skip to content

Commit 8110aab

Browse files
committed
ProcessExecutor: do not use mutable TimerResults object from parent in forked process
1 parent de03e12 commit 8110aab

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cli/processexecutor.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,13 @@ unsigned int ProcessExecutor::check()
386386
#endif
387387
close(pipes[0]);
388388

389-
// reset so we do not have the data which has already been transferred back
389+
// create a separate result object so we do not get the results which have already been transferred back
390+
std::unique_ptr<TimerResults> timerResults;
390391
if (mTimerResults)
391-
mTimerResults->reset();
392+
timerResults.reset(new TimerResults);
392393

393394
PipeWriter pipewriter(pipes[1], mSettings.debugipc);
394-
CppCheck fileChecker(mSettings, supprs, pipewriter, mTimerResults, false, mExecuteCommand);
395+
CppCheck fileChecker(mSettings, supprs, pipewriter, timerResults.get(), false, mExecuteCommand);
395396
unsigned int resultOfCheck = 0;
396397

397398
if (iFileSettings != mFileSettings.end()) {

0 commit comments

Comments
 (0)