feat: Handle SIGINT
This commit is contained in:
parent
041bf47ff4
commit
e954d49c29
@ -120,6 +120,11 @@ namespace hex::crash {
|
|||||||
|
|
||||||
// Custom signal handler to print various information and a stacktrace when the application crashes
|
// Custom signal handler to print various information and a stacktrace when the application crashes
|
||||||
static void signalHandler(int signalNumber, const std::string &signalName) {
|
static void signalHandler(int signalNumber, const std::string &signalName) {
|
||||||
|
if (signalNumber == SIGINT) {
|
||||||
|
ImHexApi::System::closeImHex();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Reset crash handlers, so we can't have a recursion if this code crashes
|
// Reset crash handlers, so we can't have a recursion if this code crashes
|
||||||
resetCrashHandlers();
|
resetCrashHandlers();
|
||||||
|
|
||||||
@ -166,6 +171,7 @@ namespace hex::crash {
|
|||||||
HANDLE_SIGNAL(SIGILL);
|
HANDLE_SIGNAL(SIGILL);
|
||||||
HANDLE_SIGNAL(SIGABRT);
|
HANDLE_SIGNAL(SIGABRT);
|
||||||
HANDLE_SIGNAL(SIGFPE);
|
HANDLE_SIGNAL(SIGFPE);
|
||||||
|
HANDLE_SIGNAL(SIGINT);
|
||||||
|
|
||||||
#if defined (SIGBUS)
|
#if defined (SIGBUS)
|
||||||
HANDLE_SIGNAL(SIGBUS);
|
HANDLE_SIGNAL(SIGBUS);
|
||||||
|
Loading…
Reference in New Issue
Block a user