Skip to content

Commit

Permalink
Remove the current connection when user cancels the operation (#7036)
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Dec 9, 2020
1 parent 9a3f6a9 commit ee1f19d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -2225,6 +2225,8 @@ void GraphicsView::addConnection(Element *pComponent)
}
}
}
// Once we are done creating the connection then we should set mpConnectionLineAnnotation to 0.
mpConnectionLineAnnotation = 0;
}
}

Expand All @@ -2234,11 +2236,11 @@ void GraphicsView::addConnection(Element *pComponent)
*/
void GraphicsView::removeCurrentConnection()
{
if (isCreatingConnection()) {
setIsCreatingConnection(false);
deleteConnectionFromList(mpConnectionLineAnnotation);
removeItem(mpConnectionLineAnnotation);
delete mpConnectionLineAnnotation;
setIsCreatingConnection(false);
deleteConnectionFromList(mpConnectionLineAnnotation);
removeItem(mpConnectionLineAnnotation);
if (mpConnectionLineAnnotation) {
mpConnectionLineAnnotation->deleteLater();
mpConnectionLineAnnotation = 0;
}
}
Expand Down

0 comments on commit ee1f19d

Please sign in to comment.