fix: edge removal
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "Gui/Network/NodeEdgeGraphic.h"
|
#include "Gui/Network/NodeEdgeGraphic.h"
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
|
#include "Engine/Operator/GeometryConnection.h"
|
||||||
#include "Gui/Network/SocketGraphic.h"
|
#include "Gui/Network/SocketGraphic.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <qgraphicsitem.h>
|
#include <qgraphicsitem.h>
|
||||||
@@ -158,6 +159,12 @@ void NodeEdgeGraphic::remove(bool full)
|
|||||||
{
|
{
|
||||||
// TODO: possible memory leak
|
// TODO: possible memory leak
|
||||||
// these probably aren't necessary but i'm trying to fix a bug
|
// these probably aren't necessary but i'm trying to fix a bug
|
||||||
|
|
||||||
|
if(connection_.expired())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
update();
|
update();
|
||||||
scene()->update();
|
scene()->update();
|
||||||
@@ -170,6 +177,8 @@ void NodeEdgeGraphic::remove(bool full)
|
|||||||
{
|
{
|
||||||
if(auto connectionShared = connection_.lock())
|
if(auto connectionShared = connection_.lock())
|
||||||
{
|
{
|
||||||
|
// remove connection
|
||||||
|
connection_ = std::weak_ptr<enzo::nt::GeometryConnection>();
|
||||||
connectionShared->remove();
|
connectionShared->remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user