mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 10:37:56 +02:00
Merge pull request #6560 from birarda/log-handler-crash
don't stop a non-started timer, debug cleanup
This commit is contained in:
commit
5bbff7534d
4 changed files with 27 additions and 12 deletions
|
@ -435,17 +435,23 @@ SharedNodePointer LimitedNodeList::nodeWithUUID(const QUuid& nodeUUID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LimitedNodeList::eraseAllNodes() {
|
void LimitedNodeList::eraseAllNodes() {
|
||||||
qCDebug(networking) << "Clearing the NodeList. Deleting all nodes in list.";
|
|
||||||
|
|
||||||
QSet<SharedNodePointer> killedNodes;
|
QSet<SharedNodePointer> killedNodes;
|
||||||
eachNode([&killedNodes](const SharedNodePointer& node){
|
|
||||||
killedNodes.insert(node);
|
|
||||||
});
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// iterate the current nodes, emit that they are dying and remove them from the hash
|
// iterate the current nodes - grab them so we can emit that they are dying
|
||||||
|
// and then remove them from the hash
|
||||||
QWriteLocker writeLocker(&_nodeMutex);
|
QWriteLocker writeLocker(&_nodeMutex);
|
||||||
_nodeHash.clear();
|
|
||||||
|
if (_nodeHash.size() > 0) {
|
||||||
|
qCDebug(networking) << "LimitedNodeList::eraseAllNodes() removing all nodes from NodeList.";
|
||||||
|
|
||||||
|
auto it = _nodeHash.begin();
|
||||||
|
|
||||||
|
while (it != _nodeHash.end()) {
|
||||||
|
killedNodes.insert(it->second);
|
||||||
|
it = _nodeHash.unsafe_erase(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const SharedNodePointer& killedNode, killedNodes) {
|
foreach(const SharedNodePointer& killedNode, killedNodes) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ NodeList::NodeList(char newOwnerType, unsigned short socketListenPort, unsigned
|
||||||
_keepAlivePingTimer.setInterval(KEEPALIVE_PING_INTERVAL_MS);
|
_keepAlivePingTimer.setInterval(KEEPALIVE_PING_INTERVAL_MS);
|
||||||
connect(&_keepAlivePingTimer, &QTimer::timeout, this, &NodeList::sendKeepAlivePings);
|
connect(&_keepAlivePingTimer, &QTimer::timeout, this, &NodeList::sendKeepAlivePings);
|
||||||
connect(&_domainHandler, SIGNAL(connectedToDomain(QString)), &_keepAlivePingTimer, SLOT(start()));
|
connect(&_domainHandler, SIGNAL(connectedToDomain(QString)), &_keepAlivePingTimer, SLOT(start()));
|
||||||
connect(&_domainHandler, &DomainHandler::disconnectedFromDomain, &_keepAlivePingTimer, &QTimer::stop);
|
connect(&_domainHandler, &DomainHandler::disconnectedFromDomain, this, &NodeList::stopKeepalivePingTimer);
|
||||||
|
|
||||||
// we definitely want STUN to update our public socket, so call the LNL to kick that off
|
// we definitely want STUN to update our public socket, so call the LNL to kick that off
|
||||||
startSTUNPublicSocketUpdate();
|
startSTUNPublicSocketUpdate();
|
||||||
|
@ -646,6 +646,12 @@ void NodeList::activateSocketFromNodeCommunication(QSharedPointer<NLPacket> pack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NodeList::stopKeepalivePingTimer() {
|
||||||
|
if (_keepAlivePingTimer.isActive()) {
|
||||||
|
_keepAlivePingTimer.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void NodeList::sendKeepAlivePings() {
|
void NodeList::sendKeepAlivePings() {
|
||||||
eachMatchingNode([this](const SharedNodePointer& node)->bool {
|
eachMatchingNode([this](const SharedNodePointer& node)->bool {
|
||||||
return _nodeTypesOfInterest.contains(node->getType());
|
return _nodeTypesOfInterest.contains(node->getType());
|
||||||
|
|
|
@ -89,6 +89,7 @@ public slots:
|
||||||
signals:
|
signals:
|
||||||
void limitOfSilentDomainCheckInsReached();
|
void limitOfSilentDomainCheckInsReached();
|
||||||
private slots:
|
private slots:
|
||||||
|
void stopKeepalivePingTimer();
|
||||||
void sendPendingDSPathQuery();
|
void sendPendingDSPathQuery();
|
||||||
void handleICEConnectionToDomainServer();
|
void handleICEConnectionToDomainServer();
|
||||||
|
|
||||||
|
|
|
@ -194,10 +194,12 @@ void Socket::clearConnections() {
|
||||||
QMetaObject::invokeMethod(this, "clearConnections", Qt::BlockingQueuedConnection);
|
QMetaObject::invokeMethod(this, "clearConnections", Qt::BlockingQueuedConnection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear all of the current connections in the socket
|
if (_connectionsHash.size() > 0) {
|
||||||
qDebug() << "Clearing all remaining connections in Socket.";
|
// clear all of the current connections in the socket
|
||||||
_connectionsHash.clear();
|
qDebug() << "Clearing all remaining connections in Socket.";
|
||||||
|
_connectionsHash.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Socket::cleanupConnection(HifiSockAddr sockAddr) {
|
void Socket::cleanupConnection(HifiSockAddr sockAddr) {
|
||||||
|
|
Loading…
Reference in a new issue