Fix infinite loop on signal handling. (#338)

* Fix infinite loop on signal handling.

Signed-off-by: KokaKiwi <kokakiwi+git@kokakiwi.net>

* Re-raise same signal in sighandler
This commit is contained in:
KokaKiwi 2021-11-09 19:14:25 +01:00 committed by GitHub
parent 434de44ef5
commit 15f81cc316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -241,7 +241,9 @@ namespace hex {
auto signalHandler = [](int signalNumber) {
EventManager::post<EventAbnormalTermination>(signalNumber);
std::raise(SIGABRT);
// Let's not loop on this...
std::signal(signalNumber, nullptr);
std::raise(signalNumber);
};
std::signal(SIGTERM, signalHandler);