COMP: clear out memory in argList (#3065)

- exit in constructor bypasses RAII
This commit is contained in:
Mark Olesen 2023-12-21 17:28:08 +01:00
parent 1d8f0d55f7
commit fffffff98d

View File

@ -1082,6 +1082,9 @@ Foam::argList::argList
<< " -help-full' for extended usage" << nl
<< nl;
args_.clear();
options_.clearStorage();
UPstream::exit(1); // works for serial and parallel
}
@ -1242,6 +1245,9 @@ void Foam::argList::parse
if (quickExit)
{
args_.clear();
options_.clearStorage();
std::exit(0);
}
}
@ -1252,6 +1258,9 @@ void Foam::argList::parse
foamVersion::printBuildInfo(Info.stdStream(), false);
FatalError.write(Info, false);
args_.clear();
options_.clearStorage();
UPstream::exit(1); // works for serial and parallel
}