From 179a65ed8b4fe39d28d570531073761ea338690a Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 9 Jan 2024 11:49:49 +0100 Subject: [PATCH] fix: Crash on exit --- main/gui/source/crash_handlers.cpp | 4 ++++ main/gui/source/init/tasks.cpp | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/main/gui/source/crash_handlers.cpp b/main/gui/source/crash_handlers.cpp index 2ddf766cb..4b013d9e4 100644 --- a/main/gui/source/crash_handlers.cpp +++ b/main/gui/source/crash_handlers.cpp @@ -167,6 +167,10 @@ namespace hex::crash { HANDLE_SIGNAL(SIGABRT); HANDLE_SIGNAL(SIGFPE); + #if defined (SIGBUS) + HANDLE_SIGNAL(SIGBUS); + #endif + #undef HANDLE_SIGNAL } diff --git a/main/gui/source/init/tasks.cpp b/main/gui/source/init/tasks.cpp index b8d985877..c3bdf6f65 100644 --- a/main/gui/source/init/tasks.cpp +++ b/main/gui/source/init/tasks.cpp @@ -67,11 +67,12 @@ namespace hex::init { EventImHexClosing::post(); EventManager::clear(); + while (ImHexApi::Provider::isValid()) + ImHexApi::Provider::remove(ImHexApi::Provider::get()); + // Terminate all asynchronous tasks TaskManager::exit(); - while (ImHexApi::Provider::isValid()) - ImHexApi::Provider::remove(ImHexApi::Provider::get()); ContentRegistry::Provider::impl::getEntries().clear(); ImHexApi::System::getInitArguments().clear();