Core: remove support for writing crash.blend file
This was a debug feature for developers that allowed writing the last MemFile undo step as a .blend file when Blender crashed. This was rarely/never used nowadays and is now removed. This is in preparation for #106903 which removes support for writing `MemFile` undo steps as .blend files.
This commit is contained in:
parent
3090a0a7f8
commit
e90f5d03c4
|
@ -54,12 +54,6 @@
|
||||||
|
|
||||||
# include "creator_intern.h" /* own include */
|
# include "creator_intern.h" /* own include */
|
||||||
|
|
||||||
// #define USE_WRITE_CRASH_BLEND
|
|
||||||
# ifdef USE_WRITE_CRASH_BLEND
|
|
||||||
# include "BKE_undo_system.hh"
|
|
||||||
# include "BLO_undofile.hh"
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* set breakpoints here when running in debug mode, useful to catch floating point errors */
|
/* set breakpoints here when running in debug mode, useful to catch floating point errors */
|
||||||
# if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
|
# if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
|
||||||
static void sig_handle_fpe(int /*sig*/)
|
static void sig_handle_fpe(int /*sig*/)
|
||||||
|
@ -97,28 +91,6 @@ static void sig_handle_crash(int signum)
|
||||||
|
|
||||||
wmWindowManager *wm = G_MAIN ? static_cast<wmWindowManager *>(G_MAIN->wm.first) : nullptr;
|
wmWindowManager *wm = G_MAIN ? static_cast<wmWindowManager *>(G_MAIN->wm.first) : nullptr;
|
||||||
|
|
||||||
# ifdef USE_WRITE_CRASH_BLEND
|
|
||||||
if (wm && wm->undo_stack) {
|
|
||||||
struct MemFile *memfile = BKE_undosys_stack_memfile_get_active(wm->undo_stack);
|
|
||||||
if (memfile) {
|
|
||||||
char filepath[FILE_MAX];
|
|
||||||
|
|
||||||
if (!(G_MAIN && G_MAIN->filepath[0])) {
|
|
||||||
BLI_path_join(filepath, sizeof(filepath), BKE_tempdir_base(), "crash.blend");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
STRNCPY(filepath, G_MAIN->filepath);
|
|
||||||
BLI_path_extension_replace(filepath, sizeof(filepath), ".crash.blend");
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Writing: %s\n", filepath);
|
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
BLO_memfile_write_file(memfile, filepath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char header[512];
|
char header[512];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue