diff --git a/src/game.cpp b/src/game.cpp index 1e330527ceb0..32779bea6384 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -786,9 +786,11 @@ int main(int argc, char** argv) } catch(const char * e) { std::cerr << "Caught a string thrown as an exception: " << e << std::endl; return 1; +#if !defined(NO_CATCH_AT_GAME_END) } catch(...) { //Added this to ensure that even when we terminate with `throw 42`, the exception is caught and all destructors are actually called. std::cerr << "Caught unspecified general exception. Terminating." << std::endl; //Apparently, some compilers will simply terminate without return 1; //calling destructors if there is no one to catch it at all. +#endif } return 0;