diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-10-17 00:19:15 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-10-17 00:19:15 +0300 |
commit | 3b6d7b5152896165c9fc27097446895301306afd (patch) | |
tree | 22e155e80ea9dbdb0974bcbba130ce9bfed87e89 /source/blender/blenkernel/intern | |
parent | d2fc4deb09ead36389858dd227631766130d913d (diff) |
Docs: Add comments on workspace removal functions
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/workspace.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c index 26df3a1ca8a..ca4c3ebb04e 100644 --- a/source/blender/blenkernel/intern/workspace.c +++ b/source/blender/blenkernel/intern/workspace.c @@ -143,6 +143,12 @@ WorkSpace *BKE_workspace_add(Main *bmain, const char *name) return new_workspace; } +/** + * The function that actually frees the workspace data (not workspace itself). It shouldn't be called + * directly, instead #BKE_workspace_remove should be, which calls this through #BKE_libblock_free then. + * + * Should something like a bke_internal.h be added, this should go there! + */ void BKE_workspace_free(WorkSpace *workspace) { for (WorkSpaceDataRelation *relation = workspace->hook_layout_relations.first, *relation_next; @@ -157,6 +163,13 @@ void BKE_workspace_free(WorkSpace *workspace) BKE_viewrender_free(&workspace->view_render); } +/** + * Remove \a workspace by freeing itself and its data. This is a higher-level wrapper that + * calls #BKE_workspace_free (through #BKE_libblock_free) to free the workspace data, and frees + * other data-blocks owned by \a workspace and its layouts (currently that is screens only). + * + * Always use this to remove (and free) workspaces. Don't free non-ID workspace members here. + */ void BKE_workspace_remove(Main *bmain, WorkSpace *workspace) { for (WorkSpaceLayout *layout = workspace->layouts.first, *layout_next; layout; layout = layout_next) { |