1
0
mirror of synced 2025-01-18 09:04:52 +01:00

fix: Crash when any signal is being thrown (#669)

This avoids a crash on POSIX after running a command from the command
pallete; on completion, a SIGCHILD will be raised, which was incorrectly
calling the error handler and terminating ImHex.

Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
This commit is contained in:
eoineoineoin 2022-08-12 10:33:20 +01:00 committed by GitHub
parent 7bc2c4a0d4
commit 72c4f50871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,10 +146,10 @@ namespace hex {
this->m_popupsToOpen.push_back(name);
});
for (u32 signal = 0; signal < NSIG; signal++) {
if (signal != SIGTERM && signal != SIGINT)
std::signal(signal, signalHandler);
}
std::signal(SIGSEGV, signalHandler);
std::signal(SIGILL, signalHandler);
std::signal(SIGABRT, signalHandler);
std::signal(SIGFPE, signalHandler);
std::set_terminate([]{ signalHandler(SIGABRT); });
auto imhexLogo = romfs::get("logo.png");