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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-04-16 18:05:58 +0300
committerBastien Montagne <bastien@blender.org>2020-04-16 18:08:46 +0300
commite9bf624a498a4f0074374740737d47c5df7fd87d (patch)
tree348138a0c194ff66f7dd19f8f1fc4143fc4efde5 /source
parent2a68b41b7df18299952f83f4499fa132c7141a1e (diff)
Fix T75680: Nodegroup user count increased when file saved in edit group mode.
This editor's code was a bit schizophrenic, some parts considering its nodetree usages as real refcounted ones, others, as shallow 'user one' ones... Editors should not be real ID users anyway, unless there are *very* good reasons for it, so swich it to fully 'shallow' usage now.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/lib_query.c9
-rw-r--r--source/blender/editors/space_node/space_node.c3
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index 9c0fa33157c..4ffdcf14fa7 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -492,16 +492,17 @@ static void library_foreach_screen_area(LibraryForeachIDData *data, ScrArea *are
FOREACH_CALLBACK_INVOKE_ID(data, snode->from, IDWALK_CB_NOP);
FOREACH_CALLBACK_INVOKE(
- data, snode->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : IDWALK_CB_USER);
+ data, snode->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : IDWALK_CB_USER_ONE);
for (path = snode->treepath.first; path; path = path->next) {
if (path == snode->treepath.first) {
/* first nodetree in path is same as snode->nodetree */
- FOREACH_CALLBACK_INVOKE(
- data, path->nodetree, is_private_nodetree ? IDWALK_CB_EMBEDDED : IDWALK_CB_NOP);
+ FOREACH_CALLBACK_INVOKE(data,
+ path->nodetree,
+ is_private_nodetree ? IDWALK_CB_EMBEDDED : IDWALK_CB_USER_ONE);
}
else {
- FOREACH_CALLBACK_INVOKE(data, path->nodetree, IDWALK_CB_USER);
+ FOREACH_CALLBACK_INVOKE(data, path->nodetree, IDWALK_CB_USER_ONE);
}
if (path->nodetree == NULL) {
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index d682cab7293..b6ee393b991 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -890,8 +890,7 @@ static void node_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, I
for (path = snode->treepath.first; path; path = path->next) {
if ((ID *)path->nodetree == old_id) {
path->nodetree = (bNodeTree *)new_id;
- id_us_min(old_id);
- id_us_plus(new_id);
+ id_us_ensure_real(new_id);
}
if (path == snode->treepath.first) {
/* first nodetree in path is same as snode->nodetree */