From deebeb27424e63a9f30cb855a4e0d72ea586d1c9 Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Mon, 2 Jul 2018 16:18:58 -0300 Subject: Add a new notification to detect crashes on native scripts --- platform/osx/crash_handler_osx.mm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform/osx/crash_handler_osx.mm') diff --git a/platform/osx/crash_handler_osx.mm b/platform/osx/crash_handler_osx.mm index 99ce25adfb..1664c5ce8e 100644 --- a/platform/osx/crash_handler_osx.mm +++ b/platform/osx/crash_handler_osx.mm @@ -78,6 +78,10 @@ static void handle_crash(int sig) { // Dump the backtrace to stderr with a message to the user fprintf(stderr, "%s: Program crashed with signal %d\n", __FUNCTION__, sig); + + if (OS::get_singleton()->get_main_loop()) + OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_CRASH); + fprintf(stderr, "Dumping the backtrace. %ls\n", msg.c_str()); char **strings = backtrace_symbols(bt_buffer, size); if (strings) { -- cgit v1.2.3