[Bf-blender-cvs] [1333a3ba5c8] temp-lineart-contained: Cleanup: set the window manager to the updated context on load

Campbell Barton noreply at git.blender.org
Sat Mar 13 02:00:59 CET 2021


Commit: 1333a3ba5c8dad9e459696e5b2267de8597fd8c0
Author: Campbell Barton
Date:   Fri Mar 12 15:35:13 2021 +1100
Branches: temp-lineart-contained
https://developer.blender.org/rB1333a3ba5c8dad9e459696e5b2267de8597fd8c0

Cleanup: set the window manager to the updated context on load

While this happened to be corrected by code that runs afterwards,
leaving this in an invalid state could cause problems in the future.

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

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 8357dfd7417..227520ed3f9 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -322,6 +322,9 @@ static void wm_window_match_replace_by_file_wm(bContext *C,
     SWAP(wmWindowManager *, oldwm, wm);
     BLI_addhead(current_wm_list, oldwm);
     BLI_addhead(readfile_wm_list, wm);
+
+    /* Don't leave the old pointer in the context. */
+    CTX_wm_manager_set(C, wm);
   }
 
   bool has_match = false;



More information about the Bf-blender-cvs mailing list