mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 21:05:04 +02:00
make sure DS log handler is cleaned up
This commit is contained in:
parent
9d2e1773a0
commit
493a9da43e
3 changed files with 22 additions and 7 deletions
|
@ -68,6 +68,8 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
||||||
LogUtils::init();
|
LogUtils::init();
|
||||||
Setting::init();
|
Setting::init();
|
||||||
|
|
||||||
|
connect(this, &QCoreApplication::aboutToQuit, this, &DomainServer::aboutToQuit);
|
||||||
|
|
||||||
setOrganizationName("High Fidelity");
|
setOrganizationName("High Fidelity");
|
||||||
setOrganizationDomain("highfidelity.io");
|
setOrganizationDomain("highfidelity.io");
|
||||||
setApplicationName("domain-server");
|
setApplicationName("domain-server");
|
||||||
|
@ -106,6 +108,11 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DomainServer::aboutToQuit() {
|
||||||
|
// clear the log handler so that Qt doesn't call the destructor on LogHandler
|
||||||
|
qInstallMessageHandler(0);
|
||||||
|
}
|
||||||
|
|
||||||
void DomainServer::restart() {
|
void DomainServer::restart() {
|
||||||
qDebug() << "domain-server is restarting.";
|
qDebug() << "domain-server is restarting.";
|
||||||
|
|
||||||
|
@ -558,7 +565,6 @@ const NodeSet STATICALLY_ASSIGNED_NODES = NodeSet() << NodeType::AudioMixer
|
||||||
<< NodeType::AvatarMixer << NodeType::EntityServer;
|
<< NodeType::AvatarMixer << NodeType::EntityServer;
|
||||||
|
|
||||||
void DomainServer::handleConnectRequest(const QByteArray& packet, const HifiSockAddr& senderSockAddr) {
|
void DomainServer::handleConnectRequest(const QByteArray& packet, const HifiSockAddr& senderSockAddr) {
|
||||||
|
|
||||||
NodeType_t nodeType;
|
NodeType_t nodeType;
|
||||||
HifiSockAddr publicSockAddr, localSockAddr;
|
HifiSockAddr publicSockAddr, localSockAddr;
|
||||||
|
|
||||||
|
@ -1341,10 +1347,14 @@ void DomainServer::pingPunchForConnectingPeer(const SharedNetworkPeer& peer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainServer::handlePeerPingTimeout() {
|
void DomainServer::handlePeerPingTimeout() {
|
||||||
SharedNetworkPeer senderPeer = _icePeers.value(qobject_cast<NetworkPeer*>(sender())->getUUID());
|
NetworkPeer* senderPeer = qobject_cast<NetworkPeer*>(sender());
|
||||||
|
|
||||||
if (senderPeer && !senderPeer->getActiveSocket()) {
|
if (senderPeer) {
|
||||||
pingPunchForConnectingPeer(senderPeer);
|
SharedNetworkPeer sharedPeer = _icePeers.value(senderPeer->getUUID());
|
||||||
|
|
||||||
|
if (sharedPeer && !sharedPeer->getActiveSocket()) {
|
||||||
|
pingPunchForConnectingPeer(sharedPeer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ public slots:
|
||||||
void restart();
|
void restart();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void aboutToQuit();
|
||||||
|
|
||||||
void loginFailed();
|
void loginFailed();
|
||||||
void readAvailableDatagrams();
|
void readAvailableDatagrams();
|
||||||
void setupPendingAssignmentCredits();
|
void setupPendingAssignmentCredits();
|
||||||
|
|
|
@ -646,10 +646,13 @@ void NodeList::startNodeHolePunch(const SharedNodePointer& node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeList::handleNodePingTimeout() {
|
void NodeList::handleNodePingTimeout() {
|
||||||
SharedNodePointer senderNode = nodeWithUUID(qobject_cast<Node*>(sender())->getUUID());
|
Node* senderNode = qobject_cast<Node*>(sender());
|
||||||
|
if (senderNode) {
|
||||||
|
SharedNodePointer sharedNode = nodeWithUUID(senderNode->getUUID());
|
||||||
|
|
||||||
if (senderNode && !senderNode->getActiveSocket()) {
|
if (sharedNode && !sharedNode->getActiveSocket()) {
|
||||||
pingPunchForInactiveNode(senderNode);
|
pingPunchForInactiveNode(sharedNode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue