Merge pull request #15234 from SimonWalton-HiFi/clear-connection-on-add-node

When adding new Node clear any dangling Connection objects
This commit is contained in:
Shannon Romano 2019-03-29 10:46:22 -07:00 committed by GitHub
commit ac0130d4c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -677,6 +677,9 @@ SharedNodePointer LimitedNodeList::addOrUpdateNode(const QUuid& uuid, NodeType_t
// If there is a new node with the same socket, this is a reconnection, kill the old node
removeOldNode(findNodeWithAddr(publicSocket));
removeOldNode(findNodeWithAddr(localSocket));
// If there is an old Connection to the new node's address kill it
_nodeSocket.cleanupConnection(publicSocket);
_nodeSocket.cleanupConnection(localSocket);
auto it = _connectionIDs.find(uuid);
if (it == _connectionIDs.end()) {