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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-09-12 13:31:31 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-09-13 15:44:36 +0300
commite082fc7c77235e46a3782e81a255be644a089e7d (patch)
tree6e068f109a19ee4fc942a3957839e11aa0606c4d /source/blender/blenkernel/intern/workspace.c
parent80f083f993d4f62a7e9c35ab946e031ca70b09cd (diff)
Workspaces: reference count screens, otherwise they are never freed.
They are not directly accessible in the UI anymore, it's the workspaces that we always keep until they are manually deleted now.
Diffstat (limited to 'source/blender/blenkernel/intern/workspace.c')
-rw-r--r--source/blender/blenkernel/intern/workspace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index a5e93c8d765..2829708391f 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -243,6 +243,7 @@ WorkSpaceLayout *BKE_workspace_layout_add(
UNUSED_VARS(bmain);
#endif
layout->screen = screen;
+ id_us_plus(&layout->screen->id);
workspace_layout_name_set(workspace, layout, name);
BLI_addtail(&workspace->layouts, layout);
@@ -253,7 +254,8 @@ void BKE_workspace_layout_remove(
Main *bmain,
WorkSpace *workspace, WorkSpaceLayout *layout)
{
- BKE_libblock_free(bmain, BKE_workspace_layout_screen_get(layout));
+ id_us_min(&layout->screen->id);
+ BKE_libblock_free(bmain, layout->screen);
BLI_freelinkN(&workspace->layouts, layout);
}