1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 09:16:01 +08:00

Fix Port Disconnect Bug (#289)

This commit is contained in:
MYTNB 2020-08-13 19:08:58 +08:00 committed by GitHub
parent 85341bf4cc
commit 1fb94b2413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -307,11 +307,7 @@ namespace XNode {
// Remove the other ports connection to this port // Remove the other ports connection to this port
NodePort otherPort = connections[i].Port; NodePort otherPort = connections[i].Port;
if (otherPort != null) { if (otherPort != null) {
for (int k = 0; k < otherPort.connections.Count; k++) { otherPort.connections.RemoveAll(it => { return it.Port == this; });
if (otherPort.connections[k].Port == this) {
otherPort.connections.RemoveAt(i);
}
}
} }
// Remove this ports connection to the other // Remove this ports connection to the other
connections.RemoveAt(i); connections.RemoveAt(i);