1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Merge pull request #15739 from poke1024/macos-catch-exception

Catch NSException in macOS run loop to prevent crashs
This commit is contained in:
Max Hilbrunner
2018-05-13 23:51:20 +02:00
committed by GitHub

View File

@@ -2427,12 +2427,21 @@ void OS_OSX::run() {
//int frames=0;
//uint64_t frame=0;
while (!force_quit) {
bool quit = false;
process_events(); // get rid of pending events
joypad_osx->process_joypads();
if (Main::iteration() == true)
break;
while (!force_quit && !quit) {
@try {
process_events(); // get rid of pending events
joypad_osx->process_joypads();
if (Main::iteration() == true) {
quit = true;
}
} @catch (NSException *exception) {
ERR_PRINTS("NSException: " + String([exception reason].UTF8String));
}
};
main_loop->finish();