From e90f5d03c4a38244676e4808ca2c7f455acd3410 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 29 Feb 2024 16:56:15 +0100 Subject: [PATCH] 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. --- source/creator/creator_signals.cc | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/source/creator/creator_signals.cc b/source/creator/creator_signals.cc index ac28c0deb5e..f752c83138a 100644 --- a/source/creator/creator_signals.cc +++ b/source/creator/creator_signals.cc @@ -54,12 +54,6 @@ # 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 */ # if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE) static void sig_handle_fpe(int /*sig*/) @@ -97,28 +91,6 @@ static void sig_handle_crash(int signum) wmWindowManager *wm = G_MAIN ? static_cast(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; char header[512];