summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2018-07-02 16:18:58 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2018-07-02 16:18:58 -0300
commitdeebeb27424e63a9f30cb855a4e0d72ea586d1c9 (patch)
tree4e533db34687cf53a33a9392ebb13bbe872c56df /platform/x11
parent2dc738ce2733757631a4ccf413a92411c4400246 (diff)
Add a new notification to detect crashes on native scripts
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/crash_handler_x11.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/x11/crash_handler_x11.cpp b/platform/x11/crash_handler_x11.cpp
index d39fc33f81..960105271b 100644
--- a/platform/x11/crash_handler_x11.cpp
+++ b/platform/x11/crash_handler_x11.cpp
@@ -55,6 +55,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) {