Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/workspace.c')
-rw-r--r--source/blender/blenkernel/intern/workspace.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index e5e6a5d67c8..324c8db0fe9 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -429,9 +429,13 @@ WorkSpace *BKE_workspace_active_get(WorkSpaceInstanceHook *hook)
}
void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace)
{
- if (hook->active == workspace) {
- return;
- }
+ /* DO NOT check for `hook->active == workspace` here. Caller code is supposed to do it if
+ * that optimization is possible and needed.
+ * This code can be called from places where we might have this equality, but still want to
+ * ensure/update the active layout below.
+ * Known case where this is buggy and will crash later due to NULL active layout: reading
+ * a blend file, when the new read workspace ID happens to have the exact same memory address
+ * as when it was saved in the blend file (extremely unlikely, but possible). */
hook->active = workspace;
if (workspace) {