cmCTestMultiProcessHandler: Explain testRun ownership in comments

The ownership semantics of the 'testRun' variable are subtle and
may fool static analysers.  Add comments explaining them for now.
Later some refactoring could be done to clarify the code.

Issue: #19610
This commit is contained in:
Brad King 2019-08-22 11:52:41 -04:00
parent 303e813438
commit 7c2767ef3b

View File

@ -189,10 +189,13 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
std::strerror(workdir.GetLastResult()));
} else {
if (testRun->StartTest(this->Completed, this->Total)) {
// Ownership of 'testRun' has moved to another structure.
// When the test finishes, FinishTestProcess will be called.
return true;
}
}
// Pass ownership of 'testRun'.
this->FinishTestProcess(testRun, false);
return false;
}