mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Rewrite the way application exits
Centralize in a single object all the global resources management and avoid a bunch of sparse exit() calls. This is more reliable and clean and more stick to C++ coding practices. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -372,7 +372,7 @@ void Book::open(const string& fName) {
|
||||
if (!good())
|
||||
{
|
||||
cerr << "Failed to open book file " << fileName << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
Application::exit_with_failure();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ void Book::read_entry(BookEntry& entry, int idx) {
|
||||
if (!good())
|
||||
{
|
||||
cerr << "Failed to read book entry at index " << idx << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
Application::exit_with_failure();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user