[Bf-blender-cvs] [6293cf61312] master: Fix T90630: Crash loading certain user preferences

Campbell Barton noreply at git.blender.org
Thu Aug 12 12:43:46 CEST 2021


Commit: 6293cf61312763152b00cb4f588061f7b281caf7
Author: Campbell Barton
Date:   Thu Aug 12 20:32:37 2021 +1000
Branches: master
https://developer.blender.org/rB6293cf61312763152b00cb4f588061f7b281caf7

Fix T90630: Crash loading certain user preferences

Clearing the window was done in wm_file_read_post which was deferred.

This was needed as it left the context in an invalid state
where the window was set but the screen wasn't.

Crashing when setting up keymaps that attempted to access the
scene from the window in the property update function.

Regression in 497bc4d19977abc7b9e2c0f5024a23057e680954

===================================================================

M	source/blender/windowmanager/intern/wm_files.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 21c16e94097..b53ad0ee927 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1343,6 +1343,9 @@ void wm_homefile_read_ex(bContext *C,
     else {
       *r_params_file_read_post = MEM_mallocN(sizeof(struct wmFileReadPost_Params), __func__);
       **r_params_file_read_post = params_file_read_post;
+
+      /* Match #wm_file_read_post which leaves the window cleared too. */
+      CTX_wm_window_set(C, NULL);
     }
   }
 }



More information about the Bf-blender-cvs mailing list