From e45f2fed4b83b9014c5cfeb20c810fe04dde0239 Mon Sep 17 00:00:00 2001 From: wangyix Date: Mon, 9 Jun 2014 13:42:45 -0700 Subject: [PATCH] changed writelock to readlock plus a coding standard fix --- assignment-client/src/octree/SentPacketHistory.cpp | 4 +++- interface/src/Application.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assignment-client/src/octree/SentPacketHistory.cpp b/assignment-client/src/octree/SentPacketHistory.cpp index 85e164bc41..0ea7fd8b69 100644 --- a/assignment-client/src/octree/SentPacketHistory.cpp +++ b/assignment-client/src/octree/SentPacketHistory.cpp @@ -37,6 +37,8 @@ const QByteArray* SentPacketHistory::getPacket(OCTREE_PACKET_SEQUENCE sequenceNu return NULL; } int packetAt = _newestPacketAt - seqDiff; - if (packetAt < 0) { packetAt += _sentPackets.size(); } + if (packetAt < 0) { + packetAt += _sentPackets.size(); + } return &_sentPackets.at(packetAt); } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 18a8d3ba12..574df09ee2 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2123,7 +2123,7 @@ void Application::sendNack() { QUuid nodeUUID = node->getUUID(); - _octreeSceneStatsLock.lockForWrite(); + _octreeSceneStatsLock.lockForRead(); // retreive octree scene stats of this node if (_octreeServerSceneStats.find(nodeUUID) == _octreeServerSceneStats.end()) {