Merge pull request #331 from Dmitry-Me/DontExitInTheMiddle
Should not call std::exit() in the middle of program
This commit is contained in:
commit
d9a3761bfd
|
@ -81,10 +81,12 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
|
|||
std::cout << ErrorLogger::ErrorMessage::getXMLFooter(settings._xml_version) << std::endl;
|
||||
}
|
||||
|
||||
if (parser.ExitAfterPrinting())
|
||||
std::exit(EXIT_SUCCESS);
|
||||
if (parser.ExitAfterPrinting()) {
|
||||
settings.terminate();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
std::exit(EXIT_FAILURE);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that all include paths exist
|
||||
|
@ -173,6 +175,9 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
|
|||
if (!parseFromArgs(&cppCheck, argc, argv)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (settings.terminated()) {
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (cppCheck.settings().exceptionHandling) {
|
||||
return check_wrapper(cppCheck, argc, argv);
|
||||
|
|
Loading…
Reference in New Issue