diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-03-09 14:56:56 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-03-09 15:11:00 +0300 |
commit | 7e5d1a9560a5d926381f4aa864623845cdb8f1b2 (patch) | |
tree | ba2bc59b14d387c031180972be1bfe4c9ad5f52a /source/blender/blenloader | |
parent | 36cd31060b6db6a81668996757bf166cfff38a22 (diff) |
Fix T57655: Crash opening 2.79 file saved with maximized area
During screen to workspace/workspace-layout conversion, the first layout
of each workspace would be activated. For temporary full-screens, this
used to be the full-screen layout (IIRC), apparently it's now the
the layout to return to on "Back to Previous". So the 'previous' layout
would be activated, not the full-screen one.
When actually pressing "Back to Previous" now, the operator would first
free the active layout (which it assumes to be the temp full-screen -
wrongly in this case) and then try to activate the non-full-screen one,
causing use-after-free.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 8a3e948e4d2..3832b671b24 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -197,12 +197,13 @@ static void do_version_workspaces_after_lib_link(Main *bmain) WorkSpace *workspace = BLI_findstring(&bmain->workspaces, screen->id.name + 2, offsetof(ID, name) + 2); BLI_assert(workspace != NULL); - ListBase *layouts = BKE_workspace_layouts_get(workspace); + WorkSpaceLayout *layout = BKE_workspace_layout_find(workspace, win->screen); + BLI_assert(layout != NULL); win->workspace_hook = BKE_workspace_instance_hook_create(bmain); BKE_workspace_active_set(win->workspace_hook, workspace); - BKE_workspace_active_layout_set(win->workspace_hook, layouts->first); + BKE_workspace_active_layout_set(win->workspace_hook, layout); /* Move scene and view layer to window. */ Scene *scene = screen->scene; |