fix: Crash backups not getting saved when when an exception is thrown
This commit is contained in:
parent
f2509cda1d
commit
9a9b211ebb
@ -55,14 +55,14 @@ namespace hex::crash {
|
||||
static void signalHandler(int signalNumber, const std::string &signalName) {
|
||||
log::fatal("Terminating with signal '{}' ({})", signalName, signalNumber);
|
||||
|
||||
// Trigger the crash callback
|
||||
crashCallback(hex::format("Received signal '{}' ({})", signalName, signalNumber));
|
||||
|
||||
// Trigger an event so that plugins can handle crashes
|
||||
// It may affect things (like the project path),
|
||||
// so we do this after saving the crash file
|
||||
EventManager::post<EventAbnormalTermination>(signalNumber);
|
||||
|
||||
// Trigger the crash callback
|
||||
crashCallback(hex::format("Received signal '{}' ({})", signalName, signalNumber));
|
||||
|
||||
// Detect if the crash was due to an uncaught exception
|
||||
if (std::uncaught_exceptions() > 0) {
|
||||
log::fatal("Uncaught exception thrown!");
|
||||
@ -113,6 +113,8 @@ namespace hex::crash {
|
||||
);
|
||||
log::fatal("Program terminated with uncaught exception: {}", exceptionStr);
|
||||
|
||||
EventManager::post<EventAbnormalTermination>(0);
|
||||
|
||||
// Handle crash callback
|
||||
crashCallback(hex::format("Uncaught exception: {}", exceptionStr));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user