mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
impr: Better recovery from exceptions thrown in main thread (#1577)
This PR improves many things which can be seen by the commit name, but the most important thing is the addition of a popup telling the user when an exception is thrown 
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <popups/popup_question.hpp>
|
||||
#include <content/popups/popup_tasks_waiting.hpp>
|
||||
#include <content/popups/popup_unsaved_changes.hpp>
|
||||
#include <content/popups/popup_crash_recovered.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
@@ -48,6 +49,10 @@ namespace hex::plugin::builtin {
|
||||
void registerEventHandlers() {
|
||||
|
||||
static bool imhexClosing = false;
|
||||
EventCrashRecovered::subscribe([](const std::exception &e) {
|
||||
PopupCrashRecovered::open(e);
|
||||
});
|
||||
|
||||
EventWindowClosing::subscribe([](GLFWwindow *window) {
|
||||
imhexClosing = false;
|
||||
if (ImHexApi::Provider::isDirty() && !imhexClosing) {
|
||||
|
||||
Reference in New Issue
Block a user