From d5d97e41699982110747d252daff427ae96a0f48 Mon Sep 17 00:00:00 2001 From: Jeducious Date: Tue, 9 Nov 2021 15:13:40 +1100 Subject: Fix T92704: Redrawing while saving crashes outside the main thread If the blend file is saved from a script in another thread, like the render thread for example, Blender will crash on the call that redraws the UI. Ref D13140 --- source/blender/windowmanager/intern/wm_files.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 67222cc07f9..0074ecc392d 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -1793,8 +1793,9 @@ static bool wm_file_write(bContext *C, /* Enforce full override check/generation on file save. */ BKE_lib_override_library_main_operations_create(bmain, true); - if (!G.background) { - /* Redraw to remove menus that might be open. */ + if (!G.background && BLI_thread_is_main()) { + /* Redraw to remove menus that might be open. + * But only in the main thread otherwise this can crash, see T92704. */ WM_redraw_windows(C); } -- cgit v1.2.3