Explicit fatal error for bad_alloc
Give the user some feedback if we're exiting due to out-of- memory condition.
This commit is contained in:
parent
e72f8e0286
commit
ce237e4a74
1 changed files with 3 additions and 0 deletions
|
@ -337,6 +337,9 @@ int main ( int argc, char **argv )
|
||||||
info = std::string("received from ") + t.getOrigin();
|
info = std::string("received from ") + t.getOrigin();
|
||||||
flightgear::fatalMessageBoxWithoutExit(
|
flightgear::fatalMessageBoxWithoutExit(
|
||||||
"Fatal exception", t.getFormattedMessage(), info);
|
"Fatal exception", t.getFormattedMessage(), info);
|
||||||
|
} catch (const std::bad_alloc&) {
|
||||||
|
flightgear::fatalMessageBoxWithoutExit("Out of memory",
|
||||||
|
"FlightGear ran out of memory and must exit.", "Consider adjusting your settings or closing other applications.");
|
||||||
} catch (const std::exception &e ) {
|
} catch (const std::exception &e ) {
|
||||||
flightgear::fatalMessageBoxWithoutExit("Fatal exception", e.what());
|
flightgear::fatalMessageBoxWithoutExit("Fatal exception", e.what());
|
||||||
} catch (const std::string &s) {
|
} catch (const std::string &s) {
|
||||||
|
|
Loading…
Reference in a new issue