diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-07-16 17:06:50 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-07-16 18:46:45 +0300 |
commit | 1f1d302950044592b8812c022897abfc838580a4 (patch) | |
tree | 681d78a843eeb75231a2f54f922acffa8870420d /source/blender/blenkernel/intern/blendfile.c | |
parent | 91f539b384168aefa096fce3aecf555e2f47efc7 (diff) |
Fix T66940, T67005, T60651: append workspace from old startup file fails
Don't try to use old screens as workspaces, just leave them out of the menu.
Differential Revision: https://developer.blender.org/D5270
Diffstat (limited to 'source/blender/blenkernel/intern/blendfile.c')
-rw-r--r-- | source/blender/blenkernel/intern/blendfile.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 570805a01d0..afbd2627a2a 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -670,9 +670,14 @@ WorkspaceConfigFileData *BKE_blendfile_workspace_config_read(const char *filepat } if (bfd) { - workspace_config = MEM_mallocN(sizeof(*workspace_config), __func__); + workspace_config = MEM_callocN(sizeof(*workspace_config), __func__); workspace_config->main = bfd->main; - workspace_config->workspaces = bfd->main->workspaces; + + /* Only 2.80+ files have actual workspaces, don't try to use screens + * from older versions. */ + if (bfd->main->versionfile >= 280) { + workspace_config->workspaces = bfd->main->workspaces; + } MEM_freeN(bfd); } |