From 883b2f2b3c66cef8ebba434810b21d75ca770d59 Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Fri, 28 Jul 2023 20:22:56 +0200 Subject: [PATCH] Improve the crash handler Co-Authored-By: Mihai Alexandru <77043862+majigsaw77@users.noreply.github.com> --- source/funkin/backend/system/modules/CrashHandler.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/funkin/backend/system/modules/CrashHandler.hx b/source/funkin/backend/system/modules/CrashHandler.hx index 0deef13a..3f64f779 100644 --- a/source/funkin/backend/system/modules/CrashHandler.hx +++ b/source/funkin/backend/system/modules/CrashHandler.hx @@ -12,6 +12,11 @@ import haxe.CallStack; class CrashHandler { public static function init() { Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onError); + #if cpp + untyped __global__.__hxcpp_set_critical_error_handler(onError); + #elseif hl + Api.setErrorHandler(onError); + #end } public static function onError(e:UncaughtErrorEvent) {