Fix T55462: Ungroup in Node editor crash Blender

If ID doesn't want to do user counting it shouldn't be in main.
This commit is contained in:
Sergey Sharybin 2019-01-25 16:49:40 +01:00
parent d96f1fcd39
commit 693721cc7e
Notes: blender-bot 2023-02-14 05:53:42 +01:00
Referenced by commit e993667a46, Fix (unreported) critical mistake in Node copying code.
Referenced by issue #55462, Ungroup in Node editor crash Blender
1 changed files with 2 additions and 1 deletions

View File

@ -1384,7 +1384,8 @@ void BKE_node_tree_copy_data(Main *UNUSED(bmain), bNodeTree *ntree_dst, const bN
bNodeTree *ntreeCopyTree_ex(const bNodeTree *ntree, Main *bmain, const bool do_id_user)
{
bNodeTree *ntree_copy;
BKE_id_copy_ex(bmain, (ID *)ntree, (ID **)&ntree_copy, do_id_user ? 0 : LIB_ID_CREATE_NO_USER_REFCOUNT, false);
const int flag = do_id_user ? LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_MAIN : 0;
BKE_id_copy_ex(bmain, (ID *)ntree, (ID **)&ntree_copy, flag, false);
return ntree_copy;
}
bNodeTree *ntreeCopyTree(Main *bmain, const bNodeTree *ntree)