From c84715b21cd9cb60cd8251635d961f0bca88beee Mon Sep 17 00:00:00 2001 From: parker Date: Tue, 19 Aug 2025 21:33:39 +0100 Subject: [PATCH] fix: edge removal --- src/Gui/Network/NodeEdgeGraphic.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Gui/Network/NodeEdgeGraphic.cpp b/src/Gui/Network/NodeEdgeGraphic.cpp index ba8ee5b..4b1a8cd 100644 --- a/src/Gui/Network/NodeEdgeGraphic.cpp +++ b/src/Gui/Network/NodeEdgeGraphic.cpp @@ -1,5 +1,6 @@ #include "Gui/Network/NodeEdgeGraphic.h" #include +#include "Engine/Operator/GeometryConnection.h" #include "Gui/Network/SocketGraphic.h" #include #include @@ -158,6 +159,12 @@ void NodeEdgeGraphic::remove(bool full) { // TODO: possible memory leak // these probably aren't necessary but i'm trying to fix a bug + + if(connection_.expired()) + { + return; + } + prepareGeometryChange(); update(); scene()->update(); @@ -170,6 +177,8 @@ void NodeEdgeGraphic::remove(bool full) { if(auto connectionShared = connection_.lock()) { + // remove connection + connection_ = std::weak_ptr(); connectionShared->remove(); } }