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:
Omar Emara
2024-12-16 11:13:30 +02:00
parent 7de4e6d2ee
commit 2eb53ba3b2

View File

@@ -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*/) {