Blender Git Loki
Git Commits -> Revision 6219d0d
Revision 6219d0d by Bastien Montagne (master) October 2, 2020, 09:47 (GMT) |
Fix (unreported) design flow in how workspace's relation data are read from .blend file. Relying on pointer addresses across different data-blocks is extremely not recommended (and should be strictly forbidden ideally), in particular in direct_link step of blend file reading. - It assumes a specific order in reading of data, which is not ensured in future, and is in any case a very bad, non explicit, hidden dependency on behaviors of other parts of the codebase. - It is intrinsically unsafe (as in, it makes writing bad code and making mistakes easy, see e.g. fix in rB84b3f6e049b35f9). - It makes advanced handling of data-blocks harder (thinking about partial undo code e.g., even though in this specific case it was not an issue as we do not re-read neither windowmanagers nor worspaces during undo). New code uses windows' `winid` instead as 'anchor' to find again proper workspace hook in windows at read time. As a bonus, it will also cleanup the list of relations from any invalid ones (afaict it was never done previously). Differential Revision: https://developer.blender.org/D9073 |
Commit Details:
Full Hash: 6219d0d145d3f2e6bd30be1c91e952e18db44e74
Parent Commit: d74d35e
Lines Changed: +91, -30
10 Modified Paths:
/source/blender/blenkernel/BKE_workspace.h (+4, -1) (Diff)
/source/blender/blenkernel/intern/workspace.c (+19, -9) (Diff)
/source/blender/blenloader/intern/readfile.c (+22, -10) (Diff)
/source/blender/blenloader/intern/readfile.h (+4, -0) (Diff)
/source/blender/blenloader/intern/versioning_280.c (+3, -3) (Diff)
/source/blender/blenloader/intern/versioning_290.c (+27, -0) (Diff)
/source/blender/editors/screen/workspace_edit.c (+1, -1) (Diff)
/source/blender/makesdna/dna_workspace_types.h (+6, -1) (Diff)
/source/blender/windowmanager/intern/wm.c (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_window.c (+4, -4) (Diff)
/source/blender/blenkernel/intern/workspace.c (+19, -9) (Diff)
/source/blender/blenloader/intern/readfile.c (+22, -10) (Diff)
/source/blender/blenloader/intern/readfile.h (+4, -0) (Diff)
/source/blender/blenloader/intern/versioning_280.c (+3, -3) (Diff)
/source/blender/blenloader/intern/versioning_290.c (+27, -0) (Diff)
/source/blender/editors/screen/workspace_edit.c (+1, -1) (Diff)
/source/blender/makesdna/dna_workspace_types.h (+6, -1) (Diff)
/source/blender/windowmanager/intern/wm.c (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_window.c (+4, -4) (Diff)