add recovery save on exception
This commit is contained in:
@@ -245,6 +245,16 @@ static void SetupExceptionHandler()
|
||||
BT_AddLogFile(wpath);
|
||||
|
||||
BT_SetPreErrHandler([](INT_PTR){
|
||||
if (ui::Canvas::I)
|
||||
{
|
||||
auto path = App::I.data_path + "/recovery.pano";
|
||||
ui::Canvas::I->project_save_thread(path);
|
||||
static char abspath[MAX_PATH];
|
||||
GetFullPathNameA(path.c_str(), MAX_PATH, abspath, NULL);
|
||||
static char message[4096];
|
||||
snprintf(message, sizeof(message), "File recovered in: %s", abspath);
|
||||
MessageBoxA(NULL, message, "File Recovery", MB_OK | MB_ICONWARNING);
|
||||
}
|
||||
LogRemote::I.file_close();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user