Network: Use unique_ptr for packets, use deque for packet queues
This commit is contained in:
@@ -204,12 +204,11 @@ bool NetworkContentSocketHandler::ReceivePackets()
|
||||
*
|
||||
* What arbitrary number to choose is the ultimate question though.
|
||||
*/
|
||||
Packet *p;
|
||||
std::unique_ptr<Packet> p;
|
||||
static const int MAX_PACKETS_TO_RECEIVE = 42;
|
||||
int i = MAX_PACKETS_TO_RECEIVE;
|
||||
while (--i != 0 && (p = this->ReceivePacket()) != nullptr) {
|
||||
bool cont = this->HandlePacket(p);
|
||||
delete p;
|
||||
bool cont = this->HandlePacket(p.get());
|
||||
if (!cont) return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user