From d8db367f6a4e49776834c82b092700dbda56cecc Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 22 Dec 2017 13:39:13 +0000 Subject: edge bend undo works --- tikzit/src/data/graph.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tikzit/src/data/graph.cpp') diff --git a/tikzit/src/data/graph.cpp b/tikzit/src/data/graph.cpp index 1985f8a..de3eb08 100644 --- a/tikzit/src/data/graph.cpp +++ b/tikzit/src/data/graph.cpp @@ -4,16 +4,17 @@ Graph::Graph(QObject *parent) : QObject(parent) { - _data = new GraphElementData(); + _data = new GraphElementData(this); _bbox = QRectF(0,0,0,0); } Graph::~Graph() { - delete _data; } void Graph::removeNode(Node *n) { + // the node itself is not deleted, as it may still be referenced in an undo command. It will + // be deleted when graph is, via QObject memory management. _nodes.removeAll(n); inEdges.remove(n); outEdges.remove(n); -- cgit v1.2.3