Skip to content

Commit

Permalink
Set source/target container figure to null after Zest connection removal
Browse files Browse the repository at this point in the history
The local variables should be cleared when the figure is removed, even
if either of the containers has already been disposed.

Amends 2288625
  • Loading branch information
ptziegler authored and azoitl committed May 26, 2024
1 parent 4cd9bc0 commit f6dc425
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,18 @@ void removeFigure() {
}
}
connectionFigure = null;
if (sourceContainerConnectionFigure != null && sourceContainerConnectionFigure.getParent() != null) {
sourceContainerConnectionFigure.getParent().remove(sourceContainerConnectionFigure);
if (sourceContainerConnectionFigure != null) {
IFigure sourceContainerConnectionParent = sourceContainerConnectionFigure.getParent();
if (sourceContainerConnectionParent != null) {
sourceContainerConnectionParent.remove(sourceContainerConnectionFigure);
}
sourceContainerConnectionFigure = null;
}
if (targetContainerConnectionFigure != null && targetContainerConnectionFigure.getParent() != null) {
targetContainerConnectionFigure.getParent().remove(targetContainerConnectionFigure);
IFigure targetContainerConnectionParent = targetContainerConnectionFigure.getParent();
if (targetContainerConnectionParent != null) {
targetContainerConnectionParent.remove(targetContainerConnectionFigure);
}
targetContainerConnectionFigure = null;
}

Expand Down

0 comments on commit f6dc425

Please sign in to comment.