From 6293cf61312763152b00cb4f588061f7b281caf7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 12 Aug 2021 20:32:37 +1000 Subject: 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 --- source/blender/windowmanager/intern/wm_files.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/windowmanager') 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); } } } -- cgit v1.2.3