Merge pull request #331 from Dmitry-Me/DontExitInTheMiddle

Should not call std::exit() in the middle of program
This commit is contained in:
Daniel Marjamäki 2014-06-06 13:35:29 +02:00
commit d9a3761bfd
1 changed files with 8 additions and 3 deletions

View File

@ -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);