Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

fix nasty undo redo crash #11

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions library/tulip-core/src/GraphStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ void GraphStorage::swapEdgeOrder(const node n, const edge e1, const edge e2) {
* @brief restore the given node in the structure and return it
*/
void GraphStorage::restoreNode(const node n) {
if (n.id == nodeData.size())
nodeData.resize(n.id + 1);
NodeData& nData = nodeData[n.id];
// clear edge infos
nData.edges.clear();
Expand All @@ -424,12 +426,7 @@ void GraphStorage::restoreNode(const node n) {
*/
node GraphStorage::addNode() {
node n(nodeIds.get());

if (n.id == nodeData.size())
nodeData.resize(n.id + 1);
else
restoreNode(n);

restoreNode(n);
return n;
}
//=======================================================
Expand Down