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:
authorBastien Montagne <bastien@blender.org>2021-01-11 18:09:11 +0300
committerBastien Montagne <bastien@blender.org>2021-01-11 18:44:19 +0300
commit1a26d1576345fb1eb3d31d3048f64b5e4f7a6109 (patch)
tree021ede378910801ad01f5a76239654403dbc1b7d /source/blender/blenkernel/intern/collection.c
parent2f9073adb140e05e0b202d237354a1bbe9d66c69 (diff)
Fix Embedded IDs creation bypassing ID management completely.
No ID (even remotely) related to Main database should ever be created directly through MEM_mallocN. Using `BKE_libblock_alloc` is the bare minimum. Note that there is no behavior change expected here.
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r--source/blender/blenkernel/intern/collection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index a553552f099..58ce7227398 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -829,8 +829,8 @@ Base *BKE_collection_or_layer_objects(const ViewLayer *view_layer, Collection *c
Collection *BKE_collection_master_add()
{
/* Not an actual datablock, but owned by scene. */
- Collection *master_collection = MEM_callocN(sizeof(Collection), "Master Collection");
- STRNCPY(master_collection->id.name, "GRMaster Collection");
+ Collection *master_collection = BKE_libblock_alloc(
+ NULL, ID_GR, "Master Collection", LIB_ID_CREATE_NO_MAIN);
master_collection->id.flag |= LIB_EMBEDDED_DATA;
master_collection->flag |= COLLECTION_IS_MASTER;
master_collection->color_tag = COLLECTION_COLOR_NONE;