fix packet receiver cleanup

This commit is contained in:
Stephen Birarda 2015-07-15 16:33:12 -07:00
parent 8f8845d78d
commit 3cba3d0dcd
3 changed files with 1 additions and 7 deletions

View file

@ -107,10 +107,6 @@ LimitedNodeList::LimitedNodeList(unsigned short socketListenPort, unsigned short
_packetReceiver.registerListener(PacketType::StunResponse, this, "processSTUNResponse");
}
LimitedNodeList::~LimitedNodeList() {
disconnect(&_nodeSocket, &QUdpSocket::readyRead, 0, 0);
}
void LimitedNodeList::setSessionUUID(const QUuid& sessionUUID) {
QUuid oldUUID = _sessionUUID;
_sessionUUID = sessionUUID;

View file

@ -248,8 +248,6 @@ protected:
LimitedNodeList(LimitedNodeList const&); // Don't implement, needed to avoid copies of singleton
void operator=(LimitedNodeList const&); // Don't implement, needed to avoid copies of singleton
~LimitedNodeList();
qint64 writePacket(const NLPacket& packet, const HifiSockAddr& destinationSockAddr,
const QUuid& connectionSecret = QUuid());
qint64 writeDatagram(const QByteArray& datagram, const HifiSockAddr& destinationSockAddr);

View file

@ -182,7 +182,7 @@ void PacketReceiver::processDatagrams() {
auto nodeList = DependencyManager::get<LimitedNodeList>();
while (nodeList->getNodeSocket().hasPendingDatagrams()) {
while (nodeList && nodeList->getNodeSocket().hasPendingDatagrams()) {
// setup a buffer to read the packet into
int packetSizeWithHeader = nodeList->getNodeSocket().pendingDatagramSize();
std::unique_ptr<char> buffer = std::unique_ptr<char>(new char[packetSizeWithHeader]);