From 15f81cc316a517854b5a9f8aa97b4c1ff36ff3d7 Mon Sep 17 00:00:00 2001 From: KokaKiwi Date: Tue, 9 Nov 2021 19:14:25 +0100 Subject: [PATCH] Fix infinite loop on signal handling. (#338) * Fix infinite loop on signal handling. Signed-off-by: KokaKiwi * Re-raise same signal in sighandler --- source/window/window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/window/window.cpp b/source/window/window.cpp index 0f67c9ace..2efcd4bb7 100644 --- a/source/window/window.cpp +++ b/source/window/window.cpp @@ -241,7 +241,9 @@ namespace hex { auto signalHandler = [](int signalNumber) { EventManager::post(signalNumber); - std::raise(SIGABRT); + // Let's not loop on this... + std::signal(signalNumber, nullptr); + std::raise(signalNumber); }; std::signal(SIGTERM, signalHandler);