renderer: always prioritize array parent over children

Fixes common segfault.
This commit is contained in:
itsmattkc
2020-07-19 12:03:31 +10:00
parent d54d59fac6
commit 70b21d6c2a
+8 -1
View File
@@ -227,8 +227,15 @@ void RenderBackend::NodeGraphChanged(NodeInput *source)
return;
}
// Check if the source is a member of this array, in which case it'll be copied eventually anyway
if (queued_input->IsArray()
&& static_cast<NodeInputArray*>(queued_input)->sub_params().contains(source)) {
return;
}
// Check if this input supersedes an already queued input
if (queued_input->parentNode()->OutputsTo(source, true)) {
if (queued_input->parentNode()->OutputsTo(source, true)
|| (source->IsArray() && static_cast<NodeInputArray*>(source)->sub_params().contains(queued_input))) {
// In which case, we don't need to queue it and can queue our own
graph_update_queue_.removeAt(i);
i--;