diff options
author | Jeducious <jameshcrowther> | 2021-11-09 07:13:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-11-09 07:18:15 +0300 |
commit | afc60f995701ec6d41a05823b248db624ea1fcc6 (patch) | |
tree | 45e893ea3cda41cdaadf02ad7157382ae3c8815a | |
parent | ab7214ca2ef93c0827d2dbb1ecbdebca184996bf (diff) |
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
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); } |