Skip to content

Commit

Permalink
Wesnothd Connection: catch all exceptions thrown in the worker thread
Browse files Browse the repository at this point in the history
This ensures a stray uncaught exception doesn't crash the game, since if an std::thread exists due to an exception, std::terminate is called.
  • Loading branch information
Vultraz committed Feb 11, 2021
1 parent 1d90f70 commit 137a511
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/wesnothd_connection.cpp
Expand Up @@ -94,6 +94,7 @@ wesnothd_connection::wesnothd_connection(const std::string& host, const std::str
} catch(const std::future_error&) {
// Handshake already complete. Do nothing.
}
} catch(...) {
}

LOG_NW << "wesnothd_connection::io_service::run() returned\n";
Expand Down

0 comments on commit 137a511

Please sign in to comment.