diff --git a/libraries/networking/src/PacketSender.cpp b/libraries/networking/src/PacketSender.cpp index 9b18bf6d29..0a19df8186 100644 --- a/libraries/networking/src/PacketSender.cpp +++ b/libraries/networking/src/PacketSender.cpp @@ -267,19 +267,20 @@ bool PacketSender::nonThreadedProcess() { while ((packetsSentThisCall < packetsToSendThisCall) && (packetsLeft > 0)) { lock(); - NodePacketPair& packetPair = _packets.pop_front(); + NodePacketPair packetPair = std::move(_packets.front()); + _packets.pop_front(); packetsLeft = _packets.size(); unlock(); // send the packet through the NodeList... - DependencyManager::get()->sendUnreliablePacket(packetPair->second(), packetPair->first()); + DependencyManager::get()->sendUnreliablePacket(packetPair.second, packetPair.first); packetsSentThisCall++; _packetsOverCheckInterval++; _totalPacketsSent++; - int packetSize = packetPair->second()->getSizeWithHeader(); + int packetSize = packetPair.second->getSizeWithHeader(); _totalBytesSent += packetSize; emit packetSent(packetSize); diff --git a/libraries/networking/src/ReceivedPacketProcessor.cpp b/libraries/networking/src/ReceivedPacketProcessor.cpp index dba00fd08a..2041b80e91 100644 --- a/libraries/networking/src/ReceivedPacketProcessor.cpp +++ b/libraries/networking/src/ReceivedPacketProcessor.cpp @@ -47,19 +47,19 @@ bool ReceivedPacketProcessor::process() { } lock(); - QVector currentPackets; + std::list currentPackets; currentPackets.swap(_packets); unlock(); - foreach(auto& packet, currentPackets) { + foreach(auto& packetPair, currentPackets) { // TODO: Replace QByteArray() once NLPacket is coming through on receive side - processPacket(packet->first(), QByteArray()); + processPacket(packetPair.first, QByteArray()); midProcess(); } lock(); - foreach(auto& packet, currentPackets) { - _nodePacketCounts[packet.getNode()->getUUID()]--; + foreach(auto& packetPair, currentPackets) { + _nodePacketCounts[packetPair.first->getUUID()]--; } unlock();