Add missing read locks to LimitedNodeList's hash

This commit is contained in:
Atlante45 2016-07-08 15:10:18 -07:00
parent d78eb19e44
commit 70cf25bd8b
2 changed files with 3 additions and 2 deletions

View file

@ -522,6 +522,7 @@ SharedNodePointer LimitedNodeList::addOrUpdateNode(const QUuid& uuid, NodeType_t
const HifiSockAddr& publicSocket, const HifiSockAddr& localSocket,
const NodePermissions& permissions,
const QUuid& connectionSecret) {
QReadLocker readLocker(&_nodeMutex);
NodeHash::const_iterator it = _nodeHash.find(uuid);
if (it != _nodeHash.end()) {

View file

@ -131,7 +131,7 @@ public:
std::function<void(Node*)> linkedDataCreateCallback;
size_t size() const { return _nodeHash.size(); }
size_t size() const { QReadLocker readLock(&_nodeMutex); return _nodeHash.size(); }
SharedNodePointer nodeWithUUID(const QUuid& nodeUUID);
@ -287,7 +287,7 @@ protected:
QUuid _sessionUUID;
NodeHash _nodeHash;
QReadWriteLock _nodeMutex;
mutable QReadWriteLock _nodeMutex;
udt::Socket _nodeSocket;
QUdpSocket* _dtlsSocket;
HifiSockAddr _localSockAddr;