Fixed #391 - NodeGrid concurrent modification
This commit is contained in:
parent
53f833b094
commit
2771f34350
1 changed files with 6 additions and 2 deletions
|
@ -26,10 +26,14 @@ public abstract class NodeGrid<N extends Node> extends Grid<N>
|
|||
if (isValidNode(connection) && connection instanceof Node)
|
||||
{
|
||||
Node connectedNode = (Node) connection;
|
||||
|
||||
|
||||
if (connectedNode.getGrid() != this)
|
||||
{
|
||||
connectedNode.getGrid().getNodes().clear();
|
||||
synchronized (connectedNode.getGrid().getNodes())
|
||||
{
|
||||
connectedNode.getGrid().getNodes().clear();
|
||||
}
|
||||
|
||||
add((N) connectedNode);
|
||||
reconstructNode((N) connectedNode);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue