mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
signal: show Windows popup window on crash (#410)
## Link to GitHub Issue, if one exists #345 ## Description of change Show a MessageBox when signal detects a crash. ## Testing Tested full screen and windowed games.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "signal.h"
|
||||
|
||||
#include <future>
|
||||
#include <exception>
|
||||
|
||||
#include <windows.h>
|
||||
@@ -174,6 +175,18 @@ static LONG WINAPI TopLevelExceptionFilter(struct _EXCEPTION_POINTERS *Exception
|
||||
log_warning("signal", "minidump creation function not available, skipping");
|
||||
}
|
||||
|
||||
// reduce sleep time since we will wait for the user to acknowledge the popup
|
||||
LOG_FATAL_SLEEP = 1;
|
||||
|
||||
// in 30 seconds, shut down (in case user can't dismiss popup)
|
||||
const auto f = std::async(std::launch::async, [] {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(30));
|
||||
log_fatal("signal", "end");
|
||||
});
|
||||
|
||||
// this will stall all UI threads for this process
|
||||
deferredlogs::show_popup_for_crash();
|
||||
|
||||
log_fatal("signal", "end");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user