diff --git a/Scripts/NodePort.cs b/Scripts/NodePort.cs index 9fa465e..6bcc638 100644 --- a/Scripts/NodePort.cs +++ b/Scripts/NodePort.cs @@ -296,12 +296,13 @@ namespace XNode { for (int i = 0; i < port.connections.Count; i++) { if (port.connections[i].Port == this) { port.connections.RemoveAt(i); + // Trigger OnRemoveConnection from this side port + port.node.OnRemoveConnection(port); } } } // Trigger OnRemoveConnection node.OnRemoveConnection(this); - if (port != null && port.IsConnectedTo(this)) port.node.OnRemoveConnection(port); } /// Disconnect this port from another port @@ -413,4 +414,4 @@ namespace XNode { } } } -} \ No newline at end of file +}