Fix: Memory leak when compositor contains unavailable links
The compositor leaks memory when the node tree contains unavailable links. That's because the compositor doesn't ignore those links when computing the reference counts for outputs. To fix this, check if the output is logically linked and return 0 in case it isn't.
This commit is contained in:
@@ -84,6 +84,10 @@ bool is_output_linked_to_node_conditioned(DOutputSocket output, FunctionRef<bool
|
||||
int number_of_inputs_linked_to_output_conditioned(DOutputSocket output,
|
||||
FunctionRef<bool(DInputSocket)> condition)
|
||||
{
|
||||
if (!output->is_logically_linked()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
output.foreach_target_socket(
|
||||
[&](DInputSocket target, const TargetSocketPathInfo & /*path_info*/) {
|
||||
|
||||
Reference in New Issue
Block a user