Fix #36266, First undo in compositor decrements usercounter without a reason. The handling of scene backpointers in render layer/composite nodes changed slightly recently, which caused a double increment

of the scene user count. The node->id pointer for these nodes is now initialized in the respective init callbacks already. The explicit assignment and increment in the ED_node_composit_default is not
necessary and just adds an increment without checking previous values and decrementing them properly.

Note that the current system still leaves the scene with "fake" users (rlayer + composite nodes) which are actually part of the scene data itself. But that's design issue with the "local" node tree data
and doesn't do any real harm.
This commit is contained in:
Lukas Toenne
2013-08-07 13:14:50 +00:00
parent 9bfbdd8118
commit 8d879829da

View File

@@ -510,13 +510,9 @@ void ED_node_composit_default(const bContext *C, struct Scene *sce)
out = nodeAddStaticNode(C, sce->nodetree, CMP_NODE_COMPOSITE);
out->locx = 300.0f; out->locy = 400.0f;
out->id = &sce->id;
id_us_plus(out->id);
in = nodeAddStaticNode(C, sce->nodetree, CMP_NODE_R_LAYERS);
in->locx = 10.0f; in->locy = 400.0f;
in->id = &sce->id;
id_us_plus(in->id);
nodeSetActive(sce->nodetree, in);
/* links from color to color */