From cd19fd6c28bb976fd1ea7448fcde45fc217e004a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 5 Oct 2012 12:18:07 +0000 Subject: [PATCH] Fix related to #32734: crash saving blend file from render_pre callback. Not sure I want to recommend anyone doing this, but the fix is simple. --- source/blender/windowmanager/intern/wm_files.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index eb6fabd03c6..7b78dbedb31 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -56,6 +56,7 @@ #include "BLI_blenlib.h" #include "BLI_linklist.h" #include "BLI_utildefines.h" +#include "BLI_threads.h" #include "BLI_callbacks.h" #include "BLF_translation.h" @@ -794,7 +795,7 @@ int WM_file_write(bContext *C, const char *target, int fileflags, ReportList *re /* blend file thumbnail */ /* save before exit_editmode, otherwise derivedmeshes for shared data corrupt #27765) */ - if (U.flag & USER_SAVE_PREVIEWS) { + if ((U.flag & USER_SAVE_PREVIEWS) && BLI_thread_is_main()) { ibuf_thumb = blend_file_thumb(CTX_data_scene(C), CTX_wm_screen(C), &thumb); }