Mono: Use exit(status) instead of abort() in exception hook

(cherry picked from commit 8759c0e31a)
This commit is contained in:
Ignacio Etcheverry 2019-04-18 13:58:55 +02:00 committed by Rémi Verschelde
parent 01b39be9e6
commit 852997e446
3 changed files with 6 additions and 7 deletions

View File

@ -30,6 +30,7 @@
#include "gd_mono.h" #include "gd_mono.h"
#include <mono/metadata/environment.h>
#include <mono/metadata/exception.h> #include <mono/metadata/exception.h>
#include <mono/metadata/mono-config.h> #include <mono/metadata/mono-config.h>
#include <mono/metadata/mono-debug.h> #include <mono/metadata/mono-debug.h>
@ -1008,7 +1009,9 @@ void GDMono::unhandled_exception_hook(MonoObject *p_exc, void *) {
if (ScriptDebugger::get_singleton()) if (ScriptDebugger::get_singleton())
ScriptDebugger::get_singleton()->idle_poll(); ScriptDebugger::get_singleton()->idle_poll();
#endif #endif
abort();
exit(mono_environment_exitcode_get());
GD_UNREACHABLE(); GD_UNREACHABLE();
} }

View File

@ -111,7 +111,8 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
void unhandled_exception(MonoException *p_exc) { void unhandled_exception(MonoException *p_exc) {
mono_unhandled_exception((MonoObject *)p_exc); // prints the exception as well mono_unhandled_exception((MonoObject *)p_exc); // prints the exception as well
abort(); // Too bad 'mono_invoke_unhandled_exception_hook' is not exposed to embedders
GDMono::unhandled_exception_hook((MonoObject *)p_exc, NULL);
GD_UNREACHABLE(); GD_UNREACHABLE();
} }

View File

@ -615,11 +615,6 @@ void debug_send_unhandled_exception_error(MonoException *p_exc) {
} }
void debug_unhandled_exception(MonoException *p_exc) { void debug_unhandled_exception(MonoException *p_exc) {
#ifdef DEBUG_ENABLED
GDMonoUtils::debug_send_unhandled_exception_error(p_exc);
if (ScriptDebugger::get_singleton())
ScriptDebugger::get_singleton()->idle_poll();
#endif
GDMonoInternals::unhandled_exception(p_exc); // prints the exception as well GDMonoInternals::unhandled_exception(p_exc); // prints the exception as well
GD_UNREACHABLE(); GD_UNREACHABLE();
} }