diff options
author | Aras Pranckevicius <aras@nesnausk.org> | 2022-08-26 11:48:48 +0300 |
---|---|---|
committer | Aras Pranckevicius <aras@nesnausk.org> | 2022-08-26 11:49:02 +0300 |
commit | 3e51ebaf5424bfe14176be2a9020e3153eab122e (patch) | |
tree | c4013bb72c7021383cf095f2479a721513fc0107 /source/blender/windowmanager/intern | |
parent | e1f8136230c7fbdbc3bf3eb9da4fe246e4604e59 (diff) |
IDManagement: fix missing WM name validation when using "keep current WM list" code path
The blendfile_liblink and blendfile_io python tests in debug fired an
assert that WMWinMan object was in Main database, but not in the ID
name map. This was caused by wm_window_match_do going into case 3
there: the new WM list is completely empty, the old list is not empty,
and it was directly using the old/current list (via
wm_window_match_keep_current_wm function), without actually
registering/validating the objects in it through the name map.
Reviewed By: Bastien Montagne
Differential Revision: https://developer.blender.org/D15787
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 07a6f4bdc80..fb3da9dc7ec 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -296,6 +296,12 @@ static void wm_window_match_keep_current_wm(const bContext *C, } } + /* we'll be using the current wm list directly; make sure + * the names are validated and in the name map. */ + LISTBASE_FOREACH (wmWindowManager *, wm_item, current_wm_list) { + BKE_main_namemap_get_name(bmain, &wm_item->id, wm_item->id.name + 2); + } + *r_new_wm_list = *current_wm_list; } |