From 7be884261f4f123ece804833c00e436a6cade1fe Mon Sep 17 00:00:00 2001 From: adepierre <24371370+adepierre@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:27:02 +0200 Subject: [PATCH] Fix crash when deleting a link while it's flowing --- ficsit-companion/src/app.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ficsit-companion/src/app.cpp b/ficsit-companion/src/app.cpp index 31ba676..dd136ca 100644 --- a/ficsit-companion/src/app.cpp +++ b/ficsit-companion/src/app.cpp @@ -181,14 +181,14 @@ void App::DeleteNode(const ax::NodeEditor::NodeId id) { if (p->link != nullptr) { - p->link->end = nullptr; + DeleteLink(p->link->id); } } for (auto& p : (*it)->outs) { if (p->link != nullptr) { - p->link->start = nullptr; + DeleteLink(p->link->id); } } nodes.erase(it); @@ -744,13 +744,13 @@ void App::Render() ax::NodeEditor::Begin("Graph", ImGui::GetContentRegionAvail()); + DeleteNodesLinks(); + DragLink(); + NudgeNodes(); RenderNodes(); RenderLinks(); - DragLink(); - DeleteNodesLinks(); - AddNewNode(); UpdateNodesRate();