From 867e3729f40528ccb0d0c5dec2766fdcaca78816 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 23 Jul 2020 18:45:59 +1000 Subject: [PATCH] renderer: check array parents/children when traversing the graph for duplicates Fixes bug where nodes would be updated out of order and segfault if they no longer existed. --- app/render/backend/renderbackend.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/render/backend/renderbackend.cpp b/app/render/backend/renderbackend.cpp index e8e3a3f6b..aa891e722 100644 --- a/app/render/backend/renderbackend.cpp +++ b/app/render/backend/renderbackend.cpp @@ -222,7 +222,7 @@ void RenderBackend::NodeGraphChanged(NodeInput *source) } // Check if this dependency graph is already queued - if (source->parentNode()->OutputsTo(queued_input, true)) { + if (source->parentNode()->OutputsTo(queued_input, true, true)) { // In which case, no further copy is necessary return; } @@ -234,7 +234,7 @@ void RenderBackend::NodeGraphChanged(NodeInput *source) } // Check if this input supersedes an already queued input - if (queued_input->parentNode()->OutputsTo(source, true) + if (queued_input->parentNode()->OutputsTo(source, true, true) || (source->IsArray() && static_cast(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); @@ -400,6 +400,7 @@ void RenderBackend::CopyNodeInputValue(NodeInput *input) { // Find our copy of this parameter Node* our_copy_node = copy_map_.value(input->parentNode()); + Q_ASSERT(our_copy_node); NodeInput* our_copy = our_copy_node->GetInputWithID(input->id()); // Copy the standard/keyframe values between these two inputs